#18146 closed Bug (needsinfo)
Exception during form validation
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.3 |
Severity: | Normal | Keywords: | model, manage, validation |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
An exception with unhelpful message occurs when the following model is validated
from django.db import models class a(models.Model): pass class b(models.Model): c_a = models.ManyToManyField(a)
Maybe it would be more neat to return an error in the validation.
Haven't checked in newer versions, could someone try to replicate it.
Change History (3)
comment:1 by , 13 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Hi, the problem came when creating an app, setting the models as above and running python manage.py validate
Maybe it has been fixed I am using 1.3.
comment:3 by , 13 years ago
Edit: re-ran the manage.py validate and it validated no probs, must have been something else in my code, or a database table name clash or something. Please leave closed.
I don't know what is meant by "the following model is validated". I don't know which of the two following models is meant, nor what, specifically, is meant by "validated". Models are validated when various management commands are run, and they must pass in order for the database tables to be created by syncdb; these models both pass that validation. Possibly something about creating model instances is meant. But lacking details on what exactly is wrong with the creation attempt and what exactly the confusing exception that result is, I have no clue what might be done to improve the situation. The models work as I would expect in a Python shell (I uppercased the model names):
In order to evaluate if we could improve whatever happens in whatever error situation was encountered, we need specific details on how the error was encountered and what exactly it was (ideally post the traceback of the exception).