#265 closed defect (wontfix)
Patch: RequiredIfOtherField and friends don't work with edit_inline
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
They look at the all_data hash and that contains all lines of the inline editing table and so they don't find the other field. Maybe this could be changed in that validators on fields that are part of an edit_inline only get passed in a dictionary of those keys that relate to their row, with bare fieldnames (without the table.rownumber prefix)?
That way those combined validators could work with inline tables, too. Otherwise any validator that uses all_data to look at other fields will break.
Change History (14)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
An additional idea to reduce possible impact: add a validate_inline setting to a model and only use _transform_new_data if validate_inline==True - that way the speed penalty of filtering the new_data dict only hits models where you explicitely require this handling.
comment:3 by , 19 years ago
Summary: | RequiredIfOtherField and friends don't work with edit_inline=True → Patch: RequiredIfOtherField and friends don't work with edit_inline=True |
---|
comment:4 by , 19 years ago
Either I'm insane or you're missing a space on line 21 of that patch. Additionally, it doesn't seem to fix the problem, at least not as I'm getting it :(
comment:5 by , 19 years ago
Cc: | added |
---|
comment:6 by , 19 years ago
Yes, correct. There is a space missing. Don't know why it is missing - maybe it's tab/space related (I still had my vim set up for tabs when editing that stuff - switched to spaces now to prevent similar foulups in the i18n branch)
comment:7 by , 19 years ago
Also see related ticket #526 (this is a general tip for others, not aimed at you, Hugo).
comment:8 by , 19 years ago
Summary: | Patch: RequiredIfOtherField and friends don't work with edit_inline=True → Patch: RequiredIfOtherField and friends don't work with edit_inline |
---|---|
Type: | enhancement |
comment:9 by , 19 years ago
Cc: | removed |
---|---|
Type: | → defect |
comment:10 by , 18 years ago
Poooh. This ticket has convered a lot of dust. May I simply ask you if this is still an issue?
comment:12 by , 18 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
comment:13 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Even if this is still an issue, newforms-admin will completely obsolete it.
comment:14 by , 17 years ago
This is indeed still an issue, I just beat my head on it for an hour or so before finding this bug.
I think this patch does the work as listed above. It works nicely with my project - edit_inline=True fields are now validated, too.
The only problem I see is that it triggers the mechanism on fields having dotted names - I don't know wether there are other situations where this might happen and so miss-trigger. But I think it shouldn't as field names should be SQL names and those only can use dotted notation with namespaces and stuff like that, but never in the form Django uses: table.rownum.fieldname