Skip to content

F24.1 — Django transfer at its limits

State Closed
Parent E24
Iteration Release 9
Start Date 2026-11-17
Closed Date 2026-11-17
Predecessors —

Stories: 2 Closed

Story State Depends on
S24.1.1 — Request field limits are a 400 problem Closed (2026-11-17) —
S24.1.2 — Export joins the resource's forward relations Closed (2026-11-17) S24.1.1

Django's request limits produce problem responses, not 500s, and an export costs a constant number of queries whether or not the viewset shapes its queryset.

S24.1.1 — Request field limits are a 400 problem

State: Closed (2026-11-17)

Acceptance:

  • GET :batchGet with more ids than Django's DATA_UPLOAD_MAX_NUMBER_FIELDS (1,000 by default) answers a 400 application/problem+json, not a 500, whatever transfer.max_rows is.
  • problem_registry() maps TooManyFieldsSent and TooManyFilesSent to BAD_REQUEST, with a detail saying which limit was exceeded and no request data.

Settled contract: details are Request has more fields than the configured limit and Request has more files than the configured limit; Django's own message is never echoed. batch_get_ids and transfer.max_rows are unchanged.

S24.1.2 — Export joins the resource's forward relations

State: Closed (2026-11-17) · Depends on: S24.1.1

Acceptance:

  • A tabular export of a viewset whose queryset has no select_related costs the same number of queries for 3 rows as for 12 when the export resource reads a forward foreign-key field (team__code).
  • TestQueryCounts pins this for an unshaped viewset beside the shaped one.

Settled contract: the export joins every forward foreign-key or one-to-one prefix of each export field's attribute, walking _meta.get_field until a plain column, reverse or many-to-many relation or unknown name; the cap count runs unjoined. No public hook; prefetching stays the viewset's job.

Acceptance

set -euo pipefail
PYTEST_ADDOPTS='tests/drf/test_transfer.py tests/drf/test_problem_details_exception_handler.py' \
  task test PACKAGE_DIRS=packages/rn-forge-django   # S24.1.1, S24.1.2