Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/collection.py
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | def get(self, request, *args, **kwargs): | ||||
"deposit/collection_list.xml", | "deposit/collection_list.xml", | ||||
context={ | context={ | ||||
"count": data["count"], | "count": data["count"], | ||||
"results": [dict(d) for d in data["results"]], | "results": [dict(d) for d in data["results"]], | ||||
}, | }, | ||||
content_type="application/xml", | content_type="application/xml", | ||||
status=status.HTTP_200_OK, | status=status.HTTP_200_OK, | ||||
) | ) | ||||
response._headers["Link"] = ",".join(links) | response["Link"] = ",".join(links) | ||||
return response | return response | ||||
def get_queryset(self): | def get_queryset(self): | ||||
"""List the deposits for the authenticated user (pagination is handled by the | """List the deposits for the authenticated user (pagination is handled by the | ||||
`pagination_class` class attribute). | `pagination_class` class attribute). | ||||
""" | """ | ||||
return Deposit.objects.filter(client=self.request.user.id).order_by("id") | return Deposit.objects.filter(client=self.request.user.id).order_by("id") | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |