sample_project/tasks/importers.py
def parse_category(self, item, field_name, source_name):
        """
        Converts the text category to a tasks.Category instance.
        """
        # Get and checks for the corresponding slug
        slug = category_map.get(self.get_value(item, source_name), None)
        if not slug:
            return None
        # Load the category instance
        try:
            return Category.objects.get(slug=slug)
        except Category.DoesNotExist:
            pass
def parse_category(self, item, field_name, source_name):
        """
        Converts the text category to a tasks.Category instance.
        """
        # Get and checks for the corresponding slug
        slug = category_map.get(self.get_value(item, source_name), None)
        if not slug:
            return None
        # Load the category instance
        try:
            return Category.objects.get(slug=slug)
        except Category.DoesNotExist:
            pass
Converts the text category to a tasks.Category instance.