Reputation: 102
I have to find the database table name of resoective model in my project, how can i do it . I previously tried the
class Meta:
db_table = 'tablenameIWant'
but how can I see the table name ?
Upvotes: 0
Views: 79
Reputation: 2331
The Meta class of models can be accessed with the _meta attribute. So:
MyModel._meta.db_table
Upvotes: 3