You're going to have to explain this a lot better, because I really
did not understand what you mean. At a *GUESS*, are you trying to prevent against db save race conditions or something?? Please clarify. Cal On 23/06/2011 20:07, Satyajit Sarangi wrote: This is my models.py of a different app .class PermiLayer(models.Model): user = models.ForeignKey(User) table = models.ForeignKey(ContentType) permi = models.IntegerField() In another app's views , I am accessing a form that has given me a username . I have to check in PermiLayer model if the username along with the table id match in it and return back the data in permi . The problem here is , User + table can be present multiple times , as in the same user and and table id . What I am doing in my code is , do an object.get.all with a filter of the username and table id that I have on Permilayer . But , object.get.all , as I have read , might just freeze my database , or slow it down considerably . Is there a faster/better way to do it ? -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. |
Re: What would be a better views.py code to achieve this particular task .
Cal Leeming [Simplicity Media Ltd] Thu, 23 Jun 2011 13:57:57 -0700
- What would be a better views.py code to... Satyajit Sarangi
- Re: What would be a better views.p... Cal Leeming [Simplicity Media Ltd]
- Re: What would be a better vie... Cal Leeming [Simplicity Media Ltd]
- Re: What would be a better... Cal Leeming [Simplicity Media Ltd]
- Re: What would be a be... Satyajit Sarangi