How to use inspectdb to generate a model for a table owned by a specific schema.

994 views
Skip to first unread message

Nemani Srinivas Murthy

unread,
Sep 9, 2021, 10:10:08 AM9/9/21
to Django users
Hi, I'm looking for a solution for generating the model.py file for a table which is owned by a specific schema <schema>.<table>, I tried the below option but no luck.

python manage.py inspectdb --database= <DB_NAME> <SCHEMA.TABLE_NAME>


carlos

unread,
Sep 9, 2021, 10:13:18 AM9/9/21
to django...@googlegroups.com

On Thu, Sep 9, 2021 at 8:09 AM Nemani Srinivas Murthy <mr.n...@gmail.com> wrote:
Hi, I'm looking for a solution for generating the model.py file for a table which is owned by a specific schema <schema>.<table>, I tried the below option but no luck.

python manage.py inspectdb --database= <DB_NAME> <SCHEMA.TABLE_NAME>


--
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/bc685fe7-93c8-4e35-b0d5-33bfe549169an%40googlegroups.com.


--
att.
Carlos Rocha

Hello Singh

unread,
Sep 10, 2021, 12:50:19 AM9/10/21
to django...@googlegroups.com
I am intermediate django developer, I want to give a try to your questions.
Simply use this command 
python manage.py inspectdb [ TABLE_NAME ]
If you use this command without table name it inspect all tables of database



On Thu, 9 Sep 2021, 19:39 Nemani Srinivas Murthy, <mr.n...@gmail.com> wrote:
Hi, I'm looking for a solution for generating the model.py file for a table which is owned by a specific schema <schema>.<table>, I tried the below option but no luck.

python manage.py inspectdb --database= <DB_NAME> <SCHEMA.TABLE_NAME>


Reply all
Reply to author
Forward
0 new messages