Django

Code

Ticket #1343 (closed: fixed)

Opened 3 years ago

Last modified 1 year ago

Validation of models on install should only traverse installed models

Reported by: russellm Assigned to: russellm
Milestone: Component: django-admin.py
Version: Keywords: django_admin validation
Cc: jakamkon@gmail.com Triage Stage: Ready for checkin
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

In this thread, Kuba Konczyk <jakamkon@gmail.com> 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.

Attachments

Change History

02/16/06 08:07:32 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #1343 (Validation of models on install should only traverse installed models)




Change Properties
Action