MCPcopy Index your code
hub / github.com/encode/django-rest-framework / get_queryset

Method get_queryset

rest_framework/relations.py:157–167  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 return super().run_validation(data)
156
157 def get_queryset(self):
158 queryset = self.queryset
159 if isinstance(queryset, (QuerySet, Manager)):
160 # Ensure queryset is re-evaluated whenever used.
161 # Note that actually a `Manager` class may also be used as the
162 # queryset argument. This occurs on ModelSerializer fields,
163 # as it allows us to generate a more expressive 'repr' output
164 # for the field.
165 # Eg: 'MyRelationship(queryset=ExampleModel.objects.all())'
166 queryset = queryset.all()
167 return queryset
168
169 def use_pk_only_optimization(self):
170 return False

Callers 8

get_choicesMethod · 0.95
_querysetMethod · 0.45
to_internal_valueMethod · 0.45
get_objectMethod · 0.45
to_internal_valueMethod · 0.45
get_filter_formMethod · 0.45
listMethod · 0.45
get_objectMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected