How to accept localized date format (e.g dd/mm/yy) in a DateField on an admin form ?

Posted by tomjerry on Stack Overflow See other posts from Stack Overflow or by tomjerry
Published on 2010-03-13T19:54:28Z Indexed on 2010/03/13 19:55 UTC
Read the original article Hit count: 279

Filed under:
|
|

Is it possible to customize a django application to have accept localized date format (e.g dd/mm/yy) in a DateField on an admin form ?

I have a model class :

class MyModel(models.Model):
date = models.DateField("Date")

And associated admin class

class MyModelAdmin(admin.ModelAdmin): pass

On django administration interface, I would like to be able to input a date in following format : dd/mm/yyyy. However, the date field in the admin form expects yyyy-mm-dd.

How can I customize things ? Nota bene : I have already specified my custom language code (fr-FR) in settings.py, but it seems to have no effect on this date input matter.

Thanks in advance for your answer

© Stack Overflow or respective owner

Related posts about python

Related posts about django