Commit e3d974a4 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

serializers: Move comment about date format to where it belongs

Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent ce395a11
......@@ -40,6 +40,10 @@ class Iso8601DateTimeField(fields.DateTimeField):
super(Iso8601DateTimeField, self).__init__(format='iso-8601', **kwargs)
# All DateTimeFields should be in ISO 8601 format so nano seconds aren't
# truncated. This is important to be able to correctly re-inject the timestamps
# string the API gives you back into queries and have the gt (greater than) and
# gte (greater or equal) operators work correctly.
serializers.ModelSerializer.serializer_field_mapping[models.DateTimeField] = \
Iso8601DateTimeField
......@@ -56,12 +60,6 @@ class PatchworkModelSerializer(serializers.ModelSerializer):
def __init__(self, *args, **kwargs):
super(PatchworkModelSerializer, self).__init__(*args, **kwargs)
# All DateTimeFields should be in ISO 8601 format so nano seconds
# aren't truncated. This is important to be able to correctly re-inject
# the timestamps string the API gives you back into queries and have
# the gt (greater than) and gte (greater or equal) operators work
# correctly.
self._pw_related = RelatedMode.primary_key
related = None
if 'request' in self.context:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment