How to make Django models not prepend the app's name to the model if the model name is the app name?

StackOverflow https://stackoverflow.com/questions/11998855

Question

So here's what's happening:

I start an app called cars and create a model called Cars. When I syncdb, it creates the table cars_cars. How do I make it so that it just create the table cars?

Also, to add to it, what if I have an app called cars and have a model called car, but want the table to be created for that model be called cars?

Était-ce utile?

La solution

That's what Meta.db_table is for.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top