Hi everyone,
I'm working on the optimization of the model of my app. The goal is to
limit the request to the database.
In this webapp every user can follow users (like twitter), and when
someone you follow publish an article, each followers reveive a mail.
I'm wondering what is the best choice of models between this 2
example :
class UserProfile(models.Model):
...
followers = ManyToMany(self)
Or
class Followers(models.Model):
poster = OneToOne(UserProfile)
followers = ManyToMany(UserProfile)
First i was thinking about the example1, but I'm afraid that of each
time I will do a UserProfile.objects.get DJANGO join UserProfile table
to itself
in order to retrieve all the followers.
What do you think ?
Thx for your help :)
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment