def save(self, *args, **kwargs):
        """
        Overwritten to save the parent id for variants. This is used to count
        the entries per filter. See catalog/utils/get_product_filters for more.
        """
        if self.product.is_variant():
            self.parent_id = self.product.parent.id
        else:
            self.parent_id = self.product.id

        try:
            float(self.value)
        except __HOLE__:
            pass
        else:
            self.value_as_float = self.value

        super(ProductPropertyValue, self).save(*args, **kwargs)
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/models.py/ProductPropertyValue.save