Django

Code

Ticket #1002 (new)

Opened 3 years ago

Last modified 2 years ago

Add an option model name arg to [modelmodule] commands

Reported by: nirvdrum Assigned to: nobody
Milestone: Component: django-admin.py
Version: Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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.

Attachments

Change History

12/05/05 21:39:08 changed by ubernostrum

Yeah, this sounded like a cool idea; if you just add a model to an app, it'd be really handy to be able to do 'django-admin.py install <appname> <modelname>' and just add the needed tables and columns for that model.

12/05/05 22:47:46 changed by anonymous

  • type changed from defect to enhancement.

05/25/06 10:13:56 changed by nirvdrum

The syncdb command seems to take care of installing new models just fine now. There's still a gap with the other commands though.

02/05/07 13:19:43 changed by SmileyChris

  • stage changed from Unreviewed to Design decision needed.

Is this still a valid and important enough enhancement to bother about?

04/11/07 14:38:13 changed by nirvdrum@negativetwenty.net

I'll take a look at this as soon as I can get a chance. I recall when I opened it that it was quite an annoying issue, but the DB commands have changed considerably since then. Moreover, I haven't started any new projects recently that would trigger the initial problem.

04/25/07 06:03:43 changed by mtredinnick

  • stage changed from Design decision needed to Accepted.

Seems reasonable to add this for the sql* commands to manage.py. Not high priority, but a good patch with a get some consideration.


Add/Change #1002 (Add an option model name arg to [modelmodule] commands)




Change Properties
Action