This commit is contained in:
Slava 2017-04-15 22:35:38 +00:00 committed by GitHub
commit 7537e39d3c

View File

@ -1306,6 +1306,12 @@ class DurationField(Field):
def to_representation(self, value): def to_representation(self, value):
return duration_string(value) return duration_string(value)
def to_native(self, value):
value = super(IntegerField, self).to_native(value)
if value is None:
return value
return int(value)
# Choice types... # Choice types...