开发者

Django: If I added new tables to database, how can I query them?

开发者 https://www.devze.com 2023-01-22 04:16 出处:网络
Django: If I added new tables to database, how can I query them? Do I need to create the relevant models first? Or django creates it by itself?

Django: If I added new tables to database, how can I query them? Do I need to create the relevant models first? Or django creates it by itself?

More specifically, I installed another django app, it created several database tables in database, and now I want to get so开发者_StackOverflow社区me specific data from them? What are the correct approaches? Thank you very much!


I suppose another django app has all model files needed to access those tables, you should just try importing those packages and use this app's models.


Django doen't follow convention over configuration philosophy. you have to explicitly create the backing model for the table and in the meta tell it about the table name...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号