Hi Folks,
*Actually I'm extending User table in some other table and this current
table I'm extending soe other table. But this time I want to filter by
using first table username How can i Do that?*

*Example:*

*class FirstTable(models.Model):*
*        user_by = models.ForeignKey(user,related_name =
'user',on_delete=...)*

*class SecondTable(models.Model):*
*     main_table = models.ForeignKey(FirstTable ,related_name = '
 firs_table_data',on_delete=...)*

*So Now I wan to do like:*

*first_data = Firsttable.objects.filter(user_by = 'username')*

*then !!!,*
*second_data = SecondTable.objects.filter(main_table.user_by.username =
'username')*
*but this is query is not working how to solve this pro*blem.

Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WYb7EZsbFn0R%3DND2VvaVbxFVDU%2B%2B%3D2NRZxg8dqmM328iQ%40mail.gmail.com.

Reply via email to