mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #24497 -- Added Widget.supports_microseconds attribute
This commit is contained in:
@@ -620,7 +620,7 @@ class BoundField(object):
|
||||
# If this is an auto-generated default date, nix the
|
||||
# microseconds for standardized handling. See #22502.
|
||||
if (isinstance(data, (datetime.datetime, datetime.time)) and
|
||||
not getattr(self.field.widget, 'supports_microseconds', True)):
|
||||
not self.field.widget.supports_microseconds):
|
||||
data = data.replace(microsecond=0)
|
||||
self._initial_value = data
|
||||
else:
|
||||
|
||||
@@ -180,6 +180,7 @@ class Widget(six.with_metaclass(MediaDefiningClass)):
|
||||
needs_multipart_form = False # Determines does this widget need multipart form
|
||||
is_localized = False
|
||||
is_required = False
|
||||
supports_microseconds = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
if attrs is not None:
|
||||
|
||||
Reference in New Issue
Block a user