Created
July 17, 2015 14:05
-
-
Save jvorcak/7f6acdd090990608afd6 to your computer and use it in GitHub Desktop.
Get all tables names in a Django project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection | |
tables = connection.introspection.table_names() | |
seen_models = connection.introspection.installed_models(tables) | |
[model._meta.db_table for model in seen_models] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment