Opened 18 years ago
Closed 17 years ago
#3484 closed (duplicate)
Poor error message (or functionality) when using unsaved models as foreign keys
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This reduced case untested, sorry.
from django.db import models class X(models.Model): pass class Y(models.Model): x = models.ForeignKey(X) x = X() Y(x=x).save()
The result,
IntegrityError: ERROR: null value in column "presenter_id" violates not-null constraint
, is cryptic at best. Maybe rather than improving the error message, it should recursively save all unsaved models?
Change History (4)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
I think just improving the error message would be enough. But what does core think?
comment:3 by , 18 years ago
Summary: | Poor error message (or functionality) → Poor error message (or functionality) when using unsaved models as foreign keys |
---|
comment:4 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #3016, I believe; fixing that should fix this.
Note:
See TracTickets
for help on using tickets.
Oops, not
presenter_id
, butx_id