Let’s say i have several different models in django project. Now i need to implement reddit-like rating system, that can be easily added to any model in the project. Model look like this:
class Rating(models.Model):
vote = models.IntegerField(blank=False, null=False)
user = models.ForeignKey(User)
The question is – how to connect this ‘abstract’ model to any other model in project?
You need generic relations from built-in contenttypes framework.