how to do query inner join in django 1.11

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to do query inner join in django 1.11

Angel Omar Rojas Pacheco
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/50e5ffa6-014f-456e-be6b-fa6759a85ba3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to do query inner join in django 1.11

Cristiano Coelho
.select_related or prefetch_related? Depends on if it's a 1-Many or Many-Many relationship.

El jueves, 16 de noviembre de 2017, 13:58:32 (UTC-3), Angel Omar Rojas Pacheco escribió:
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 <a href="http://auser.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fauser.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJAsldzV4g9uMgvyuHX1CsUXnmIg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fauser.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJAsldzV4g9uMgvyuHX1CsUXnmIg&#39;;return true;">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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2459403f-0e05-4817-8c97-6525b722e006%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to do query inner join in django 1.11

Angel Omar Rojas Pacheco
Hello Cristiano, my relation ship data base is in this case one to many.
thanks

On Thursday, November 16, 2017 at 11:38:27 PM UTC-2, Cristiano Coelho wrote:
.select_related or prefetch_related? Depends on if it's a 1-Many or Many-Many relationship.

El jueves, 16 de noviembre de 2017, 13:58:32 (UTC-3), Angel Omar Rojas Pacheco escribió:
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 <a href="http://auser.id" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fauser.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJAsldzV4g9uMgvyuHX1CsUXnmIg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fauser.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJAsldzV4g9uMgvyuHX1CsUXnmIg&#39;;return true;">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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52404297-de08-4931-9bfa-5973417c3509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.