![](/img/trans.png)
[英]django: Take table name as input from user and show the content of the table from database
[英]Show the table name in database regarding the model in django
我必须在我的项目中找到反应模型的数据库表名,我该怎么做。 我以前试过
class Meta:
db_table = 'tablenameIWant'
但是我怎么能看到表名呢?
可以使用_meta属性访问模型的 Meta 类。 所以:
MyModel._meta.db_table
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.