Skip to content

Sorting by date + pagination #63

@cerahmed

Description

@cerahmed

Hey thanks for sharing this great app.

I just stumbled upon this repo while trying to implement the same functionality. It works great, but I couldn't get sorting to work the way I wanted.

So I have models A and B - both share a created datetime field. I'd like the FlatMultipleModelAPIView to return the results from multiple models sorted by the shared datetime field. The issue is, it only sorts results per page while pagination is enabled.

That is, say I have 20 records for model A created Today, and 20 records for model B that were created yesterday, and the page limit is 20. I expect that the first page shows all 20 records of model B, and the second page shows the records of model A. However, the result I get for the first page is 10 records of each model, sorted by the date created.

Any way to work around this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions