We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you have a serializer like this with a IntegerRangeField
IntegerRangeField
class StuffSerializer(serializers.ModelSerializer): numbers = IntegerRangeField( default=NumericRange(lower=0, upper=86400), required=False, allow_null=True, )
At creation time it will create a query that has a double cast '(,)'::numrange::int4range
'(,)'::numrange::int4range
This happens because NumericRange is casted by the psycopq transformer.
NumericRange
psycopq
The text was updated successfully, but these errors were encountered:
You can work around this bug by defining custom fields:
class MyIntegerRangeField(IntegerRangeField): range_type = Int4Range class StuffSerializer(serializers.ModelSerializer): numbers = MyIntegerRangeField( default=Int4Range(lower=0, upper=86400), required=False, allow_null=True, )
Sorry, something went wrong.
No branches or pull requests
If you have a serializer like this with a
IntegerRangeField
At creation time it will create a query that has a double cast
'(,)'::numrange::int4range
This happens because
NumericRange
is casted by thepsycopq
transformer.The text was updated successfully, but these errors were encountered: