I have a NOTIFICATION and an USER app in Django. The code goes something like :
class Notification(models.Model):
user = mo
OneToManyField
doesn't exist in Django because it is just the reverse relationship of a ForeignKey
. So you don't need the notifications
field on the User
model here, just remove it.
Don't worry prematurely about performance of filtering on the notifications. Querying relations is what SQL was designed for, and that's what relational databases are good at doing.