-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
i has created_at field, i need to set default ordering = -created_at (latest first)
if I set ordering in quaryset , can't work (ninja-extra change the order)
@http_get(
path="",
response={
HTTPStatus.OK: PaginatedResponseSchema[CampaignSchema],
HTTPStatus.INTERNAL_SERVER_ERROR: error_schema
},
summary="Campaign List",
description="This endpoint retrieves a list of campaigns.",
url_name="campaign_list"
)
@paginate()
@ordering(Ordering, ordering_fields=['name'])
@searching(Searching, search_fields=['name'])
def list(self):
records = self.model.objects.all().order_by("-created_at")
return records
Metadata
Metadata
Assignees
Labels
No labels