Skip to content

Skill Group

Model

Bases: Model

This is a skill group entity based on SF msf__Skill_Definition__c.json

Source code in backend/skills/models.py
class SkillGroup(models.Model):
    "This is a skill group entity based on SF msf__Skill_Definition__c.json"

    name = models.CharField(max_length=255, unique=True)
    salesforce_ref = models.CharField(max_length=255, blank=True)
    type = models.CharField(max_length=255, choices=SkillGroupType.choices, blank=True)
    is_active = models.BooleanField(default=True)

    class Meta:
        ordering = ["-pk"]
        verbose_name = "Skill Group"
        verbose_name_plural = "Skill Groups"
        db_table = "skill_groups"
        indexes = [
            models.Index(fields=["name"]),
            models.Index(fields=["salesforce_ref"]),
        ]

    def __str__(self):
        return self.name

    @property
    def is_in_salesforce(self) -> bool:
        """Check if the Skill Group is in Salesforce."""
        return bool(self.salesforce_ref)

    @classmethod
    def get_language_group(cls):
        """
        Retrieve the SkillGroup instance with the name "Language skills".

        Returns
        -------
        SkillGroup or None
            The SkillGroup instance with name "Language skills" if found, otherwise None.

        Notes
        -----
        This method is a convenience for accessing the language-related skill group,
        which is commonly used for language proficiency features.
        """
        return cls.objects.filter(name=LANGUAGE_GROUP_NAME).first()

    @classmethod
    def get_core_skills_groups(cls):
        """
        Retrieve the queryset of SkillGroup instances excluding language and working conditions groups.

        Returns
        -------
        QuerySet[SkillGroup]
            A queryset of SkillGroup instances excluding those with names "Language skills" and "Working conditions".
        """
        return cls.objects.exclude(
            name__in=[LANGUAGE_GROUP_NAME, WORKING_CONDITIONS_GROUP_NAME, DRIVING_LICENSE_GROUP_NAME]
        )

    @classmethod
    def get_driving_skills_group(cls):
        """
        Retrieve the SkillGroup instance with the name "Driving licence types".

        Returns
        -------
        SkillGroup or None
            The SkillGroup instance with name "Driving licence types" if found, otherwise None.
        """
        return cls.objects.filter(name=DRIVING_LICENSE_GROUP_NAME).first()

    @classmethod
    def get_working_conditions_group(cls):
        """
        Retrieve the SkillGroup instance with the name "Working conditions".

        Returns
        -------
        SkillGroup or None
            The SkillGroup instance with name "Working conditions" if found, otherwise None.
        """
        return cls.objects.filter(name=WORKING_CONDITIONS_GROUP_NAME).first()

is_in_salesforce property

Check if the Skill Group is in Salesforce.

get_core_skills_groups() classmethod

Retrieve the queryset of SkillGroup instances excluding language and working conditions groups.

Returns

QuerySet[SkillGroup] A queryset of SkillGroup instances excluding those with names "Language skills" and "Working conditions".

Source code in backend/skills/models.py
@classmethod
def get_core_skills_groups(cls):
    """
    Retrieve the queryset of SkillGroup instances excluding language and working conditions groups.

    Returns
    -------
    QuerySet[SkillGroup]
        A queryset of SkillGroup instances excluding those with names "Language skills" and "Working conditions".
    """
    return cls.objects.exclude(
        name__in=[LANGUAGE_GROUP_NAME, WORKING_CONDITIONS_GROUP_NAME, DRIVING_LICENSE_GROUP_NAME]
    )

get_driving_skills_group() classmethod

Retrieve the SkillGroup instance with the name "Driving licence types".

Returns

SkillGroup or None The SkillGroup instance with name "Driving licence types" if found, otherwise None.

Source code in backend/skills/models.py
@classmethod
def get_driving_skills_group(cls):
    """
    Retrieve the SkillGroup instance with the name "Driving licence types".

    Returns
    -------
    SkillGroup or None
        The SkillGroup instance with name "Driving licence types" if found, otherwise None.
    """
    return cls.objects.filter(name=DRIVING_LICENSE_GROUP_NAME).first()

get_language_group() classmethod

Retrieve the SkillGroup instance with the name "Language skills".

Returns

SkillGroup or None The SkillGroup instance with name "Language skills" if found, otherwise None.

Notes

This method is a convenience for accessing the language-related skill group, which is commonly used for language proficiency features.

Source code in backend/skills/models.py
@classmethod
def get_language_group(cls):
    """
    Retrieve the SkillGroup instance with the name "Language skills".

    Returns
    -------
    SkillGroup or None
        The SkillGroup instance with name "Language skills" if found, otherwise None.

    Notes
    -----
    This method is a convenience for accessing the language-related skill group,
    which is commonly used for language proficiency features.
    """
    return cls.objects.filter(name=LANGUAGE_GROUP_NAME).first()

get_working_conditions_group() classmethod

Retrieve the SkillGroup instance with the name "Working conditions".

Returns

SkillGroup or None The SkillGroup instance with name "Working conditions" if found, otherwise None.

Source code in backend/skills/models.py
@classmethod
def get_working_conditions_group(cls):
    """
    Retrieve the SkillGroup instance with the name "Working conditions".

    Returns
    -------
    SkillGroup or None
        The SkillGroup instance with name "Working conditions" if found, otherwise None.
    """
    return cls.objects.filter(name=WORKING_CONDITIONS_GROUP_NAME).first()

Remapping config

Source data

[
  {
    "name": "Id",
    "type": "id",
    "idLookup": true
  },
  {
    "name": "OwnerId",
    "type": "reference",
    "idLookup": false
  },
  {
    "name": "IsDeleted",
    "type": "boolean",
    "idLookup": false
  },
  {
    "name": "Name",
    "type": "string",
    "idLookup": true
  },
  {
    "name": "CreatedDate",
    "type": "datetime",
    "idLookup": false
  },
  {
    "name": "CreatedById",
    "type": "reference",
    "idLookup": false
  },
  {
    "name": "LastModifiedDate",
    "type": "datetime",
    "idLookup": false
  },
  {
    "name": "LastModifiedById",
    "type": "reference",
    "idLookup": false
  },
  {
    "name": "SystemModstamp",
    "type": "datetime",
    "idLookup": false
  },
  {
    "name": "msf__Available_for_Job_Alerts__c",
    "type": "boolean",
    "idLookup": false
  },
  {
    "name": "msf__Default_Search_Behavior__c",
    "type": "picklist",
    "idLookup": false,
    "picklist_options": [
      {
        "label": "At least 1 Search Value",
        "value": "At least 1 Search Value",
        "default": true
      },
      {
        "label": "All Search Values",
        "value": "All Search Values",
        "default": false
      }
    ]
  },
  {
    "name": "msf__Skill_tags__c",
    "type": "string",
    "idLookup": false
  },
  {
    "name": "msf__Textkernel_fieldname__c",
    "type": "string",
    "idLookup": false
  },
  {
    "name": "msf__Textkernel_language_skill__c",
    "type": "boolean",
    "idLookup": false
  },
  {
    "name": "msf__Type__c",
    "type": "picklist",
    "idLookup": false,
    "picklist_options": [
      {
        "label": "Free Text",
        "value": "Free Text",
        "default": true
      },
      {
        "label": "Evaluation",
        "value": "Evaluation",
        "default": false
      }
    ]
  },
  {
    "name": "msf__Use_for_Accounts__c",
    "type": "boolean",
    "idLookup": false
  },
  {
    "name": "msf__Use_for_Candidates__c",
    "type": "boolean",
    "idLookup": false
  },
  {
    "name": "msf__Add_to_Job_Applicants_automatically__c",
    "type": "picklist",
    "idLookup": false,
    "picklist_options": [
      {
        "label": "Yes",
        "value": "Yes",
        "default": false
      },
      {
        "label": "No",
        "value": "No",
        "default": true
      }
    ]
  },
  {
    "name": "msf__Sorting_Order__c",
    "type": "picklist",
    "idLookup": false,
    "picklist_options": [
      {
        "label": "None",
        "value": "None",
        "default": true
      },
      {
        "label": "Name Ascending",
        "value": "Name Ascending",
        "default": false
      },
      {
        "label": "Name Descending",
        "value": "Name Descending",
        "default": false
      }
    ]
  }
]