feature: export the project's current (draft) state as a PDF #22

Merged
Gilles merged 1 commit from feature/pdf-export-drafts into master 2026-10-31 08:03:43 +00:00
Owner

Closes #21.

Lets "Exporter en PDF" target a project directly, not just an already-validated ProjectVersion -- renders the live Place/Spec tree (apps.exports.snapshot.build_current_context), each spec's current_version() regardless of draft/validated status. The default template marks draft specs with a "brouillon" tag and says "État courant du projet (brouillon, non figé)" on the cover instead of a version number.

PdfExportJob.project is now a real field (was derived from project_version via a property) and project_version is nullable -- a draft export has no ProjectVersion to point at. The create API accepts either project_version (export a validated version, as before) or project (export the current state); the serializer rejects both missing.

Test plan

  • manage.py test -- 145/145 passing (6 new/updated in apps.exports)
  • pylint apps.exports -- 10.00/10
  • autopep8 --diff clean
  • bandit -- 0 issues
  • Migration applies cleanly on a fresh database and backfills project from project_version for any pre-existing row

🤖 Generated with Claude Code

https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm

Closes #21. Lets "Exporter en PDF" target a project directly, not just an already-validated ProjectVersion -- renders the live Place/Spec tree (`apps.exports.snapshot.build_current_context`), each spec's `current_version()` regardless of draft/validated status. The default template marks draft specs with a "brouillon" tag and says "État courant du projet (brouillon, non figé)" on the cover instead of a version number. `PdfExportJob.project` is now a real field (was derived from `project_version` via a property) and `project_version` is nullable -- a draft export has no `ProjectVersion` to point at. The create API accepts either `project_version` (export a validated version, as before) or `project` (export the current state); the serializer rejects both missing. ## Test plan - [x] `manage.py test` -- 145/145 passing (6 new/updated in `apps.exports`) - [x] `pylint apps.exports` -- 10.00/10 - [x] `autopep8 --diff` clean - [x] `bandit` -- 0 issues - [x] Migration applies cleanly on a fresh database and backfills `project` from `project_version` for any pre-existing row --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm
feature: export the project's current (draft) state as a PDF
All checks were successful
ci / test (pull_request) Successful in 3m38s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
edaff6411a
Lets "Exporter en PDF" target a project directly, not just an already
-validated ProjectVersion -- renders the live Place/Spec tree via
apps.exports.snapshot.build_current_context(), each spec's
current_version() regardless of its draft/validated status. The
default template now marks draft specs with a small "brouillon" tag
and a draft-colored left border, and the cover page says "État
courant du projet (brouillon, non figé)" instead of a version number.

PdfExportJob.project is now a real field (was derived from
project_version via a property) and project_version is nullable: a
draft export has no ProjectVersion to point at. The create API accepts
either project_version (export a validated version, as before) or
project (export the current state) -- PdfExportJobSerializer.validate()
rejects both missing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm
Author
Owner
<!-- argus-link-bot:thierryade/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/thierryade/backend/pr/22)
Gilles merged commit 2ae18cde97 into master 2026-10-31 08:03:43 +00:00
Gilles deleted branch feature/pdf-export-drafts 2026-10-31 08:03:43 +00:00
Sign in to join this conversation.
No description provided.