Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#1343 closed defect (fixed)

Validation of models on install should only traverse installed models

Reported by: Russell Keith-Magee Owned by: Russell Keith-Magee
Component: Core (Management commands) Version:
Severity: minor Keywords: django_admin validation
Cc: jakamkon@… Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In this thread, Kuba Konczyk <jakamkon@…> noted the following problem:

I have two applications in my project app1 and app2 with defined
models and app2 model  have error(s).I want to install app1:

$ django-admin.py install app1
Error: app1 couldn't be installed, because there were errors in your model:
app2.choices: At least one field in Choice should have core=True,
because it's being edited inline by polls.Poll.

Both models are separated,so why when I want to install app1 I get
error about app2?I just want to install app1, I don't care about app2
model now.

'django_admin.py/manage.py install app1 app2  ... appN ' command is
using 'get_validation_errors' function to validate models.For every
application from command line  'get_validation_errors' validate _all_
models from installed modules.

django-admin should only validate the model being installed, as well as checking for dependencies that haven't been installed. At present, the traversal algorithm validates all models that are available in the project directory.

Change History (1)

comment:1 by Russell Keith-Magee, 18 years ago

Resolution: fixed
Status: newclosed

(In [2310]) magic-removal: Fixes #1343 -- Modified model validator to only validate the model being installed. Includes unit test framework changes to allow validation tests.

Note: See TracTickets for help on using tickets.
Back to Top