input_formats in django admin has no effect
Posted
by pablo
on Stack Overflow
See other posts from Stack Overflow
or by pablo
Published on 2010-04-20T16:01:12Z
Indexed on
2010/04/20
16:43 UTC
Read the original article
Hit count: 259
I'm trying to use input_foramts in the admin but it has no effect. What am I doing wrong?
# model
class Feedback(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
# admin form class FeedbackAdminForm(forms.ModelForm): created_at = forms.DateTimeField(input_formats=('%d/%m/%Y',)) class Meta: model = Feedback
# admin class FeedbackAdmin(admin.ModelAdmin): form = FeedbackAdminForm admin.site.register(Feedback, FeedbackAdmin)
Thanks
© Stack Overflow or respective owner