Document stores: local media built in, an interface for keeping copies elsewhere #13
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
Postulo/postulo#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why this exists
postulo-paperless (#15) wants every document — rendered CVs, rendered letters, the files a person uploaded — in Paperless. The right shape, per the rule in CONTRIBUTING ("prefer an interface with a built-in plugin over a hard-coded implementation"), is a store interface with today's behaviour as the built-in store, not a Paperless-shaped hook in the documents app.
What exists today
UploadedDocument.fileandRenderedDocument.file(documents/models.py), under the privateMEDIA_ROOT, served throughserve_private_file(core/files.py). Renders are produced bysnapshot_cvandsnapshot_letterwhen a person records what they sent.core/export.py,MEDIA_PREFIX).Shape
postulo.stores. Contract:put(document, file, metadata) -> ExternalRef,open(ref)orurl(ref), optionaldelete(ref), optionalbrowse(query)for a later read-back stage, andtest().metadatais a small dataclass — kind (CV render, letter render, upload and itsDocumentKind), title, company, application, dates, language, tags — enough for any archive to file it sensibly.RenderedDocumentorUploadedDocument, through the tasks framework — network calls in a request are what #4 already warned about — with retries and a per-document status the person can see ("archived to Paperless", "failed: …", "not sent").ExternalRefstored beside the document (store, id, URL) and carried in the export as metadata, so a restored instance still knows where its copies went.Classification
Enhancement. Not breaking: with no external store configured, nothing changes.
Open questions
browse()optional for it.