#1207: [PATCH] Manipulators ignore default values, fields can't be omitted from
forms
----------------------------+-----------------------------------------------
Reporter: akaihola | Owner: jacob
Type: defect | Status: new
Priority: normal | Milestone:
Component: Core framework | Version:
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by James Bennett <[EMAIL PROTECTED]>):
This feels like we need to decide, and document more clearly up-front,
what `default` really means, because it ends up being confusing -- there's
the way it actually works, and there's the way that a lot of people seem
to assume it works, and they're two different things. Both make sense, but
we need to settle on which one is best and document it aggressively.
For the record, here are the two different interpretations, which differ
on when exactly the value should be filled in:
1. The way it actually works is that the `default` value is pre-filled in
the FormWrapper instance, so that when the form is displayed to a user,
the value will be in there -- the user can then leave it as-is, or change
it if desired.
2. The way many people seem to assume it works is that the value will be
filled after the fact if the form comes in with no value for the field in
question.
The disadvantage of (1) is that, in order to take advantage of the default
value, you must actually include the field in what the end user sees;
otherwise, the field comes back with no value and the only reasonable
thing for Django to assume is that the user manually changed the value
from its default to blank; often this will end up tripping a validation
error, because the undisplayed field is usually going to be required.
The disadvantage of (2) is that it we could end up having to do lots of
second-guessing about input values -- did the user really mean to submit
an empty string (which is not inconceivable), in which case it should be
left alone, or did the user leave the field alone (or was the field left
out of the end user's display), in which case it should be replaced with
the default. That seems like it could be quite a can of worms.
--
Ticket URL: <http://code.djangoproject.com/ticket/1207>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---