If I have a Django (1.6) model, I can find out its database table name with MyModel._meta.db_table
.
Is there any way to do the reverse?
I could do it an ugly way, for instance by hardcoding a large dictionary of all the tables we have to all the models we have, but people won't remember to keep it updated.
If there is no direct way, is there a way to get a list of all the models in the models.pys of the currently installed apps so I can dynamically build that dictionary?