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: wgunadi@… 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)

fix_patch.txt (702 bytes ) - added by wgunadi@… 19 years ago.
Suggested fix

Download all attachments as: .zip

Change History (7)

by wgunadi@…, 19 years ago

Attachment: fix_patch.txt added

Suggested fix

comment:1 by wgunadi_at_nextcoder.net, 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 anonymous, 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:3 by rjwittams, 19 years ago

This is fixed correctly in new-admin.

comment:4 by wgunadi@…, 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 rjwittams, 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.

comment:6 by rjwittams, 19 years ago

Resolution: fixed
Status: newclosed

Fixed in new-admin merge.

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