user469652
user469652

Reputation: 51271

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

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 some specific data from them? What are the correct approaches? Thank you very much!

Upvotes: 0

Views: 90

Answers (2)

devmiles.com
devmiles.com

Reputation: 10014

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.

Upvotes: 1

mossplix
mossplix

Reputation: 3865

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...

Upvotes: 0

Related Questions