#899: Formfield doesn't display default value
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: reopened | Component: django.newforms
Version: SVN | Resolution:
Keywords: | Stage: Ready for checkin
Has_patch: 1 | Needs_docs: 0
Needs_tests: 1 | Needs_better_patch: 0
----------------------------------+-----------------------------------------
Comment (by David Danier <[EMAIL PROTECTED]>):
Sorry for the duplicate, I really didn't see this one year old ticket.
About the patches:[[BR]]
If I read ModelField.get_default() right this returns "" (empty string) as
an last option, even if no default is provided. ModelField.get_default()
actually generates some default if no default is provided. That's why I
tested Field.has_default() in my code. Even if this has no real
consequence in HTML-forms (value="" is the default that gets sent by the
browser if no input is made), it only seemed unclean to me, because
FormField.initial is different to ModelField.default, but it looks the
same and may lead to confusion or mistakes (when working with the forms
outside of some generic views/the admin).
--
Ticket URL: <http://code.djangoproject.com/ticket/899#comment:6>
Django Code <http://code.djangoproject.com/>
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?hl=en
-~----------~----~----~----~------~----~------~--~---