I know this exists
django-admin.py inspectdb > models.py
However, is there an easy way to limit it? Without manually deleting what I don’t want.
I’m connecting to a database that has over one hundred tables, but I only want models of about 4 or 5. Is there an easy way to generate models from a few given tables?
They are quite big tables, so I don’t fancy typing them all out either.
I just did this myself, also with Oracle. It’s possible – but not pretty.
Assuming you know the names of the tables you want –
open
django/db/backends/oracle/introspection.py. There is a functionget_table_list:Just replace it with something like
Then run your
inspectdband it will be a lot more managable 🙂