WeblateOrg / WeblateOrg/weblate

Utilize Django fetch modes

Open
#21,071 0 comments 0 reactions 1 assignee Claimed by @amCap1712 View on GitHub
Waiting for: Implementation
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### Describe the problem

Django 6.1 introduces [fetch modes](https://docs.djangoproject.com/en/6.1/topics/db/fetch-modes/) which are definitely useful to optimize database access.

### Solution brainstorm

* Use `FETCH_RAISE` for existing prefetch-heavy queries that are expected to not fetch additional data on demand to fail.
* Use `FETCH_PEERS` might be a preferable solution to existing wide prefetch invocations for optionally needed data.

### Describe alternatives you have considered

_No response_

### Screenshots

_No response_

### Additional context

* https://docs.djangoproject.com/en/6.1/releases/6.1/
* Can be done once we update the dependency to Django 6.1, what in turn is blocked by several third-party libraries for now.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.