Code

Opened 4 years ago

Closed 4 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

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by russellm

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

comment:2 Changed 4 years ago by niall

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

Duplicate of #14217

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.