Hi, SplitDateTimeField does not allow you to specify input_formats, it initiates the MultiValueField with fields = (DateField(), TimeField()).
As a work-around, I defined a custom field and a widget, and used them as follows. I hope this will save someone time. class mySplitDateTimeField(forms.fields.SplitDateTimeField): def __init__(self, date_input_formats=None, time_input_formats=None, *args, **kwargs): fields = (forms.fields.DateField(input_formats=date_input_formats), forms.fields.TimeField(input_formats=time_input_formats)) forms.fields.MultiValueField.__init__(self, fields, *args, **kwargs) class mySplitDateTimeWidget(widgets.SplitDateTimeWidget): def __init__(self, attrs=None): widgets.MultiWidget.__init__(self, widgets=(forms.TextInput(attrs={'class': 'vDateField required'}), forms.TextInput(attrs={'class': 'vTimeField required'})), attrs=attrs) def format_output(self, rendered_widgets): return u'''<table> <tr><td>%s</td><td>%s</td></tr> <tr><td>%s</td><td>%s</td></tr> </table>''' % (_('Date'), rendered_widgets[0], _('Time'), rendered_widgets[1]) class EventForm(forms.form_for_model(Event)): def __init__(self, *args, **kwargs): self.base_fields['start_date'] = mySplitDateTimeField(widget=mySplitDateTimeWidget(), date_input_formats=('%d/%m/%Y',), time_input_formats=('%H:%M',)) super(EventForm, self).__init__(*args, **kwargs) This allows you to define input formats for date and time seperately. While this work-around works for me, I still think that there should be a unified way to pass attributes to each component of a MultiValueField. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---