class MyModelAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
field = super(MyModelAdmin,self).formfield_for_dbfield(db_field,**kwargs)
if isinstance(db_field, models.DateField)
return forms.DateField(input_formats=('%d-%m',), widget=SelectDateWidget(input_format='%d-%B', null=True))
return field
или
class MyModelAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
field = super(MyModelAdmin,self).formfield_for_dbfield(db_field,**kwargs)
if db_field.name == 'birth_day_month':
return forms.DateField(label=_('Birth day_month'), required=False, input_formats=('%d-%m',), widget=SelectDateWidget(input_format='%d-%B', null=True))
return field
Это с виджетом по ссылке, можно и без него, используя
input_formats