Add an option model name arg to [modelmodule] commands
|Reported by:||nirvdrum||Owned by:||nobody|
|Component:||Core (Management commands)||Version:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
A few of us were batting this idea around in the IRC channel just recently. The idea came up to enhance "install", although "sqlclear" and "sqldump" were mentioned shortly thereafter.
The basic idea is that if I were to have a project named "project" and a model named "Blah" in that project, that I could execute:
django-admin.py install project Blah
and django would execute the SQL necessary to install Blah and only that SQL. The use case trying to be addressed here is the addition of a new model. The "install" command currently fails because it attempts to install existing models and bails out. The usual recourse is to use "sqlall", but with a lot of models, finding all the correct 'auth_permissions' insert statements and what not can be a tedious and error-prone process. Given that the model being added is precisely only an addition, it should not be problematic to add this model in isolation. The extended syntax would allow this.
The same sort of rationale follows for other such commands.