#2599 closed defect (fixed)
[PATCH] raw_id_admin field has incorrect value in admin form after validation errors
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | 0.95 |
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 |
Description
I'm not sure what this is all about, I'm I was having the following problem:
In the admin for an object that has a raw_id_admin field, when opening an object for editing, the value of the text input is correct: a comma-separated list of IDs:
<input type="text" value="1,2,3" ... />
However, when saving the object but getting validation errors, the form field suddenly contains the repr
of the equivalent Python list in the value attribute:
<input type="text" value="['1', '2', '3']" ... />
I'll attach a patch that fixes this, but I'm really not sure where the actual problem is, and where it should be ideally fixed.
Attachments (1)
Change History (4)
by , 18 years ago
Attachment: | django_2599.diff added |
---|
comment:1 by , 18 years ago
How do I replicate this problem? Is it a matter of creating a custom form manipulator and model?
comment:2 by , 18 years ago
The patch looks correct and I think you are fixing the problem in the right place, don't worry.
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Quick and dirty fix for the problem