Overridden the prepare_query_value method in SequenceField inorder to return the value as the required type.
This commit is contained in:
parent
7ce34ca019
commit
c9dc441915
@ -1517,6 +1517,14 @@ class SequenceField(BaseField):
|
|||||||
|
|
||||||
return super(SequenceField, self).__set__(instance, value)
|
return super(SequenceField, self).__set__(instance, value)
|
||||||
|
|
||||||
|
def prepare_query_value(self, op, value):
|
||||||
|
"""
|
||||||
|
This method is overriden in order to convert the query value into to required
|
||||||
|
type. We need to do this in order to be able to successfully compare query
|
||||||
|
values passed as string, the base implementation returns the value as is.
|
||||||
|
"""
|
||||||
|
return self.value_decorator(value)
|
||||||
|
|
||||||
def to_python(self, value):
|
def to_python(self, value):
|
||||||
if value is None:
|
if value is None:
|
||||||
value = self.generate()
|
value = self.generate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user