Get all table names in a Django app

前端 未结 4 1997
谎友^
谎友^ 2020-12-24 12:16

How to get all table names in a Django app?

I use the following code but it doesn\'t get the tables created by ManyToManyField

from django.db.models          


        
4条回答
  •  自闭症患者
    2020-12-24 12:58

    The simplest method should be to use the database reflection APIs in django to go directly to the database. The drawback to this is that it won't give you any tables before you've synced.

提交回复
热议问题