Opened 14 years ago

Last modified 13 years ago

#13949 closed

readonly fields can't be modified via cleaned_data in forms — at Version 1

Reported by: alk Owned by: nobody
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gabriel Hurley)

if you make a model with readonly fields, the value of that field can't be set in a clean() validator in that model's form - this isn't mentioned in the documentation anywhere as far as I can see, should be added I think

Change History (1)

comment:1 by Gabriel Hurley, 14 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

It's true that the data for read-only fields are not available in cleaned_data. This is because read-only fields are displayed as text rather than as input elements, and thus are not posted back to the server, and so are not in the data that gets cleaned.

Mentioning this fact couldn't hurt.

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