def get_category(self):
        object = self.get_parent()

        try:
            return object.get_categories()[0]
        except IndexError:
            return None
Returns the first category of a product.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/models.py/Product.get_category