django - How do I inspectdb 1 table from database which Contains 1000 tables -
i got schema contains 1000 tables,and many of them don't need, how can inspectdb tables need?
you can in python console, or in *.py file:
from django.core.management.commands.inspectdb import command django.conf import settings your_project_dir.settings import databases # replace `your_project_dir` settings.configure() settings.databases = databases command().execute(table_name_filter=lambda table_name: table_name in ('table_what_you_need_1', 'table_what_you_need_2', ), database='default')
https://github.com/django/django/blob/master/django/core/management/commands/inspectdb.py#l32
Comments
Post a Comment