Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

newforms-admin: Fixed #5547. SplitDateTimeField now honors the defaul…

…t value from the model.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7178 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ea78533a288ecb2174ba83dff7654f06793dd8b9 1 parent 3d61eb4
Brian Rosner brosner authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/contrib/admin/options.py
6 django/contrib/admin/options.py
View
@@ -152,9 +152,9 @@ def formfield_for_dbfield(self, db_field, **kwargs):
# For DateTimeFields, use a special field and widget.
if isinstance(db_field, models.DateTimeField):
- return forms.SplitDateTimeField(required=not db_field.blank,
- widget=widgets.AdminSplitDateTime(), label=capfirst(db_field.verbose_name),
- help_text=db_field.help_text, **kwargs)
+ kwargs['form_class'] = forms.SplitDateTimeField
+ kwargs['widget'] = widgets.AdminSplitDateTime()
+ return db_field.formfield(**kwargs)
# For DateFields, add a custom CSS class.
if isinstance(db_field, models.DateField):
Please sign in to comment.
Something went wrong with that request. Please try again.