MCPcopy Index your code
hub / github.com/Flagsmith/flagsmith / list

Method list

api/experimentation/views.py:260–272  ·  view source on GitHub ↗
(self, request: Request, *args: object, **kwargs: object)

Source from the content-addressed store, hash-verified

258 return qs.order_by("-created_at")
259
260 def list(self, request: Request, *args: object, **kwargs: object) -> Response:
261 response = super().list(request, *args, **kwargs)
262 base_qs = super().get_queryset()
263 q = request.query_params.get("q")
264 if q:
265 base_qs = base_qs.filter(
266 Q(name__icontains=q) | Q(feature__name__icontains=q)
267 )
268 counts = base_qs.aggregate(
269 **{s.value: Count("id", filter=Q(status=s.value)) for s in ExperimentStatus}
270 )
271 response.data["status_counts"] = counts
272 return response
273
274 def create(self, request: Request, *args: object, **kwargs: object) -> Response:
275 serializer = self.get_serializer(data=request.data)

Callers 4

my_groupsMethod · 0.45
summariesMethod · 0.45
get_item_generatorFunction · 0.45
common.pyFile · 0.45

Calls 2

get_querysetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected