Django Model

17 views
Skip to first unread message

muazzem_ hossain

unread,
May 14, 2020, 12:03:40 PM5/14/20
to Django users
how to get django all app model.

Derek

unread,
May 14, 2020, 1:23:06 PM5/14/20
to Django users
>>> from django.apps import apps
>>> apps.all_models['app_name']

So if your app is called, for example, products, then:

>>> apps.all_models['products']

Will create a dictionary with all the model classes from that app.

muazzem_ hossain

unread,
May 14, 2020, 3:28:42 PM5/14/20
to django...@googlegroups.com
Thank you for help

--
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/2406a55d-8d5a-406d-ba61-aee086a11352%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages