Opened 17 years ago
Closed 12 years ago
#8579 closed New feature (fixed)
Move admin validation to only run as part of "validate" management command
| Reported by: | Malcolm Tredinnick | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Normal practice within Django is that validation code is only run when requested, since code is correct more often than it is wrong. The admin validation code runs every time a URL conf file is imported and DEBUG = True. It should be moved to be part of the django-admin.py validate run.
This isn't entirely trivial, since it's a bit tied up with admin registration and that's an issue when admin.autodiscover() is used.
Change History (6)
comment:1 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 15 years ago
| Triage Stage: | Accepted → Design decision needed |
|---|
comment:3 by , 15 years ago
| Triage Stage: | Design decision needed → Accepted |
|---|
@ramiro - I'm pretty sure that's what Malcolm would have been accepting. ./manage.py validate at the moment is a nest of isinstance checks and other special cases. It *should* be something that anyone field, model or app can hook into in a reliable way.
comment:4 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → New feature |
comment:5 by , 14 years ago
| Easy pickings: | unset |
|---|---|
| UI/UX: | unset |
This ticket has been referenced (e.g. https://code.djangoproject.com/ticket/16283#comment:7) as the ticket for making validation extensible, but really its a more specific thing that blocks on extensible validation. I could edit the title and description to broaden this ticket, but I don't want to lose the specific piece of moving admin validation, which can be done in a separate commit after we have extensible validation.
So I'm going to leave #16905 open as the ticket for extensible validation, and just note here that this (as well as #3055) blocks on #16905.
comment:6 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
The intention is is noble, but one issue I see with the proposal is that this would tie a core management command to a contrib app. Maybe the validation management command can be given some more generic mechanism third party apps can hook into to run their own out off-line, one time validation processes?