Help to implement join query in django orm

61 views
Skip to first unread message

Avi shah

unread,
Jul 22, 2022, 2:47:37 AM7/22/22
to django...@googlegroups.com
I have two tables 
Tbl 1 
Tbl 2 

I need to connect the two tables using a join 


Thanks and regards, 
Avi shah 

Ryan Nowakowski

unread,
Jul 23, 2022, 3:00:23 PM7/23/22
to django...@googlegroups.com
On Fri, Jul 22, 2022 at 12:16:14PM +0530, Avi shah wrote:
> I have two tables
> Tbl 1
> &
> Tbl 2
>
> I need to connect the two tables using a join

If these tables were created outside of Django, in other words, not
using manage.py migrate, you can use Django's legacy database support to
auto generate the models[1]. After that, each table will have a model
associated with it. You can then use Django's ForeignKey support to query
the tables.


[1] https://docs.djangoproject.com/en/4.0/howto/legacy-databases/


Lalit Suthar

unread,
Jul 24, 2022, 1:47:57 AM7/24/22
to django...@googlegroups.com

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20220723185935.GB15838%40fattuba.com.

Abhishek Gupta

unread,
Jul 24, 2022, 1:05:43 PM7/24/22
to django...@googlegroups.com
Hey, you have to write custom raw query for join tables which are not connected with foreign key relationship in django.

Jitendra kumar Patra

unread,
Jul 24, 2022, 1:07:59 PM7/24/22
to django...@googlegroups.com
Ping me 7008080545

--
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...@googlegroups.com.

Mihir Patel

unread,
Jul 25, 2022, 3:48:43 AM7/25/22
to django...@googlegroups.com
is anyone having login issue? , i am unable to authenticate a user in my website

Amitesh Sahay

unread,
Jul 25, 2022, 3:53:31 AM7/25/22
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages