Saturday, July 23, 2022

Re: Help to implement join query in django orm

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/


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

No comments:

Post a Comment