diff --git a/AUTHORS b/AUTHORS
index 268f5a2..cd93da0 100644
a
|
b
|
answer newbie questions, and generally made Django that much better:
|
586 | 586 | Richard Davies <richard.davies@elastichosts.com> |
587 | 587 | Richard House <Richard.House@i-logue.com> |
588 | 588 | Rick Wagner <rwagner@physics.ucsd.edu> |
| 589 | Ridley Larsen <ridley@velocitywebworks.com> |
589 | 590 | Robert Coup |
590 | 591 | Robert Myers <myer0052@gmail.com> |
591 | 592 | Roberto Aguilar <roberto@baremetal.io> |
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 4f38418..dfa18c6 100644
a
|
b
|
class SplitDateTimeWidget(MultiWidget):
|
891 | 891 | |
892 | 892 | def decompress(self, value): |
893 | 893 | if value: |
894 | | value = to_current_timezone(value) |
| 894 | if isinstance(value, six.string_types): |
| 895 | return value.split(',') |
| 896 | else: |
| 897 | value = to_current_timezone(value) |
895 | 898 | return [value.date(), value.time().replace(microsecond=0)] |
896 | 899 | return [None, None] |
897 | 900 | |
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 4b11fed..c947d2e 100644
a
|
b
|
templates used by the :class:`ModelAdmin` views:
|
1736 | 1736 | A hook for the initial data on admin change forms. By default, fields are |
1737 | 1737 | given initial values from ``GET`` parameters. For instance, |
1738 | 1738 | ``?name=initial_value`` will set the ``name`` field's initial value to be |
1739 | | ``initial_value``. |
| 1739 | ``initial_value``. ManyToManyFields can be populated with a comma-separated |
| 1740 | list of PKs, and DateTimeFields can be populated with comma-separated |
| 1741 | date, time. |
1740 | 1742 | |
1741 | 1743 | This method should return a dictionary in the form |
1742 | 1744 | ``{'fieldname': 'fieldval'}``:: |
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 8ead8ee..98e3e85 100644
a
|
b
|
class PrePopulatedTest(TestCase):
|
4331 | 4331 | response = self.client.get(reverse('admin:admin_views_prepopulatedpostlargeslug_add')) |
4332 | 4332 | self.assertContains(response, "maxLength: 1000") # instead of 1,000 |
4333 | 4333 | |
| 4334 | def test_changeform_intial_data(self): |
| 4335 | """ |
| 4336 | Regression test for #9739 |
| 4337 | Tests the prepopulation of fields within the admin site. |
| 4338 | """ |
| 4339 | # Add sections for testing <select>. |
| 4340 | s1 = Section.objects.create(name='Section 1') |
| 4341 | # Prepopulate the Article add page with GET data. |
| 4342 | querystring = '?title=TestTitle&content=Lorem%20Ipsum&date=2011-06-01,18:21:53§ion=1' |
| 4343 | response = self.client.get( |
| 4344 | reverse('admin:admin_views_article_add') + querystring |
| 4345 | ) |
| 4346 | self.assertEqual(response.status_code, 200) |
| 4347 | # test if the prepopulated values are within the response and in the correct fields |
| 4348 | self.assertContains(response, text='value="TestTitle"') |
| 4349 | self.assertContains(response, text='Lorem Ipsum') |
| 4350 | self.assertContains(response, text='value="2011-06-01"') |
| 4351 | self.assertContains(response, text='value="18:21:53"') |
| 4352 | self.assertContains(response, text='<option value="%s" selected="selected">' % (s1.pk)) |
| 4353 | |
4334 | 4354 | |
4335 | 4355 | @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'], |
4336 | 4356 | ROOT_URLCONF="admin_views.urls") |