def generate_hash(self):
        content_field = get_content_object_field(self)
        related_object = getattr(self, content_field.name)
        uniq = '%s.%s' % (related_object._meta, related_object.pk)
        return hashlib.sha1(uniq).hexdigest()
dataset/ETHPy150Open django-de/django-simple-ratings/ratings/models.py/RatedItemBase.generate_hash/original