Re: DB joining 3 tables in django admin, while searching on the primary table
You may be able to use prefetch_related to do what you want: it will all depend upon your model structure. select_related is easier, but only follows an fk in one direction.
Matt.
On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote:
-- On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote:
Hi,
again, my models are Customer, Users and Devices.
I would like to search by Customer and retrieve all 'select_related' rows of all the three models.
Eg. like this..
Customer1 User1 Device1
Customer1 User1 Device2
Customer1 User2 Device1
Customer1 User2 Device2
etc etc..
Is this possible in Django? If so how?
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/QJ87PppeEKcJ.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home