I have a slight issue with dates in Django and Google App Engine:
I have the following class because I want date input in the form of DD/MM/YY:
class MyForm(ModelForm):
mydate = forms.DateTimeField(input_formats=['%d-%m-%y', '%d/%m/%y'])
class Meta:
model = MyObject
This works for entering into the datastore.
However when I use a generic view to edit the data the form comes back in the format of YYYY-MM-DD. Any ideas on how to change that?
forms.DateInput takes a format keyword argument, and this can be used to control the format that is represented (I seem to remember, anyway):
I ended up subclassing both the Field and the Widget, as I wanted to be able to control the formats even more.