mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Merge 4be4dccc91
into fd72a814f8
This commit is contained in:
commit
7537e39d3c
|
@ -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...
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user