def get_displayed_properties(self):
        """
        Returns properties with ``display_on_product`` is True.
        """
        from lfs.caching.utils import get_cache_group_id
        pid = self.get_parent().pk
        properties_version = get_cache_group_id('global-properties-version')
        group_id = '%s-%s' % (properties_version, get_cache_group_id('properties-%s' % pid))
        cache_key = "%s-%s-displayed-properties-%s" % (group_id, settings.CACHE_MIDDLEWARE_KEY_PREFIX, self.id)
        properties = cache.get(cache_key)
        if properties:
            return properties

        properties = []
        for ppv in self.property_values.filter(property__display_on_product=True, type=PROPERTY_VALUE_TYPE_DISPLAY).order_by('property_group__name', 'property__position'):
            if ppv.property.is_select_field:
                try:
                    po = PropertyOption.objects.get(pk=int(float(ppv.value)))
                except (PropertyOption.DoesNotExist, __HOLE__):
                    continue
                else:
                    value = po.name
                    position = po.position
            else:
                value = ppv.value
                position = 1

            properties.append({
                "name": ppv.property.name,
                "title": ppv.property.title,
                "value": value,
                "position": (ppv.property.position * 1000) + position,
                "unit": ppv.property.unit,
                "property_group": ppv.property_group,
                "property_group_id": ppv.property_group_id if ppv.property_group else 0
            })
        cache.set(cache_key, properties)
        return properties
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/models.py/Product.get_displayed_properties