This line causes a database query:
"""
Generates and returns a tuple representing the Typescript field name and Type.
"""
# For PrimaryKeyRelatedField, set field_type to the type of the primary key
# on the related model
if isinstance(field, serializers.PrimaryKeyRelatedField) and field.queryset:
is_many = False
I think what is wanted is
if isinstance(field, serializers.PrimaryKeyRelatedField) and field.queryset is not None:
otherwise the queryset is fulfilled to see if it has any results.
I'll do a PR...
This line causes a database query:
I think what is wanted is
otherwise the queryset is fulfilled to see if it has any results.
I'll do a PR...