Opened 19 years ago
Closed 19 years ago
#629 closed defect (fixed)
[patch] ChangeManipulator does not correctly display <select> when the data is an id type
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | change manipulator |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When a field in a Change Manipulator form is a relation to another object/table, the __dict__ stores:
field_name + "_id"
as the key to the dictionary entry. For example:
{'name': 'CCN_PRJ1_PROD_R2', 'appname_id': 2, 'id': 5} Notice that the appname field is keyed as 'appname_id'
So, when the Change Manipulator code in formfields.py:getitem() tries to get the data, it won't find it.
Attachments (1)
Change History (7)
by , 19 years ago
Attachment: | fix_patch.txt added |
---|
comment:1 by , 19 years ago
SUGGESTED FIX:
When the data is percieved as None, I've inserted a simple check if using the "fieldname_id" will yield a different result than blank. If it is, then we know that this data is a relation to an existing object. So the <select> will be rendered correctly.
Diff containing the fix is attached.
comment:2 by , 19 years ago
Summary: | ChangeManipulator does not correctly display <select> when the data is an id type → [patch] ChangeManipulator does not correctly display <select> when the data is an id type |
---|
comment:4 by , 19 years ago
milestone: | Version 1.0 |
---|
Yes but applications that uses the Change Manipulators will still have this problem if not fixed on the formfield.py. This patch (or something else) need to be applied.
comment:5 by , 19 years ago
Yes, the plan is to merge the new-admin branch back to trunk.
There is no point adding an incompatible fix to trunk before that.
Suggested fix