SelectDateWidget cannot handle datetime fields. I subclassed the
widget:

class DatetimeSelectDateWidget(SelectDateWidget):
    """Overrides render to provide string value expected by
SelectDateWidget.
    """
    def render(self, name, value, attrs=None):
        # The SelectDateWidget in django cannot handle datetime value,
incredibly.
        if value is not None:
        value = str(value)
        return super(FixedSelectDateWidget, self).render(name, value,
attrs)



On Apr 1, 9:22 am, "Rocio Figueroa" <[EMAIL PROTECTED]> wrote:
> Hello
> Within a form, a field date:
>
> UserForm = forms.models.form_for_instance(user)
> UserForm.base_fields [ 'record'].widget = SelectDateWidget()
>
> Does not shows the correct value, always shows the value of January 1,
> 2008, showing how to make the correct value
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to