how to do query inner join in django 1.11

26 views
Skip to first unread message

Angel Omar Rojas Pacheco

unread,
Nov 16, 2017, 11:58:32 AM11/16/17
to Django users
hello peolpe

I need your help please, I read documentation django rest framework/serialize, but isn't find my solution, I need this query in django:

select * from auth_user as auser inner join profilecolonybit_profile as profileu on auser.id=profileu.user_id

this show me all users and profiles related with similar id

but de documentation not show me an example like my query

please help me.

thanks

regards
Angel.

Cristiano Coelho

unread,
Nov 16, 2017, 8:38:27 PM11/16/17
to Django users
.select_related or prefetch_related? Depends on if it's a 1-Many or Many-Many relationship.

Angel Omar Rojas Pacheco

unread,
Nov 17, 2017, 7:19:20 AM11/17/17
to Django users
Hello Cristiano, my relation ship data base is in this case one to many.
thanks
Reply all
Reply to author
Forward
0 new messages