Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

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

…t value from the model.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ea78533a288ecb2174ba83dff7654f06793dd8b9 1 parent 3d61eb4
@brosner brosner authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/contrib/admin/
6 django/contrib/admin/
@@ -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):

0 comments on commit ea78533

Please sign in to comment.
Something went wrong with that request. Please try again.