Opened 5 years ago

Closed 5 years ago

#13057 closed (duplicate)

Missing validation of child models

Reported by: vzima Owned by: nobody
Component: Database layer (models, ORM) Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In Django1.1 validation of models does not report when child model has declared field with same name as one to one field that links parent model and child model.

For example:

class Parent(models.Model)
  pass

class Child(Parent)
  child = models.CharField()

raises ValueError when I want to set string value for field 'child', because

Parent.child == Child.parent.child == Child.child #OneToOneField(Child) instead CharField which is replaced

Change History (2)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by niall

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14217

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