MCPcopy Create free account
hub / github.com/HumanSignal/label-studio / get_queryset

Method get_queryset

label_studio/projects/api.py:380–394  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

378 redirect_kwarg = 'pk'
379
380 def get_queryset(self):
381 serializer = GetFieldsSerializer(data=self.request.query_params)
382 serializer.is_valid(raise_exception=True)
383 fields = serializer.validated_data.get('include')
384 projects = Project.objects.with_counts(fields=fields).filter(
385 organization=self.request.user.active_organization
386 )
387
388 # Only annotate FSM state for UI/API consumption when both feature flags are enabled
389 if flag_set('fflag_feat_fit_568_finite_state_management', user=self.request.user) and flag_set(
390 'fflag_feat_fit_710_fsm_state_fields', user=self.request.user
391 ):
392 projects = projects.with_state()
393
394 return projects
395
396 def get(self, request, *args, **kwargs):
397 return super(ProjectAPI, self).get(request, *args, **kwargs)

Callers

nothing calls this directly

Calls 6

GetFieldsSerializerClass · 0.90
flag_setFunction · 0.90
filterMethod · 0.80
with_countsMethod · 0.80
getMethod · 0.45
with_stateMethod · 0.45

Tested by

no test coverage detected