WeblateOrg / WeblateOrg/weblate

Switch to cursor pagination for API

Open
#21,696 1 comment 0 reactions 0 assignees View on GitHub
Area: API Waiting for: Implementation
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### Describe the problem

The API pagination currently always counts all objects. This can be slow in many situations. The similar issue exists with using offset.

### Solution brainstorm

These kind of problems are typically solved by using cursor pagination instead. DRF already has `CursorPagination` implementation: https://www.django-rest-framework.org/api-guide/pagination/#cursorpagination

### Describe alternatives you have considered

_No response_

### Screenshots

_No response_

### Additional context

This will be a breaking change for some API consumers.

Contributor guide

Open the contributing guide

Research direction

The issue points to Django REST Framework's CursorPagination documentation; start by tracing the existing API pagination configuration and the endpoints that currently count or use offsets. Define the affected API surface and verify that pagination follows cursor semantics, with the breaking-change impact for consumers accounted for.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.