Opened 14 years ago

Closed 13 years ago

#1690 closed defect (duplicate)

Validators which check other fields don't work with edit_inline

Reported by: Esaj Owned by: Adrian Holovaty
Component: Validators Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Validators which check other fields don't work with edit_inline.

Take django.core.validators.RequiredIfOtherFieldEquals for example:

This validates by checking if all_data[self.other_field] equals self.other_value. However, with edit_inline, all_data contains keys of the form foo.0.field_name, hence using self.other_field as a key for all_data doesn't work.

Ideally, for edit_inline, the validator should be passed a modified all_data dict with only the relevant fields in it. Maybe DotExpandedDict would come in handy when implementing this?

Change History (2)

comment:1 Changed 14 years ago by Malcolm Tredinnick <malcolm@…>

There are a couple of sides to this behaviour, it seems. I am trying to start a discussion on the developers list to work out what we really want to do here:

comment:2 Changed 13 years ago by Gary Wilson <gary.wilson@…>

Resolution: duplicate
Status: newclosed

I'm marking this a dup of #265 as it appears to be the same issue and has some code attached.

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