MCMS Files
mcms_files provides managed file and media handling for MCMS. It separates the file's domain identity and metadata from the physical storage of its bytes and from the persistence of its metadata.
Responsibilities
- Represent managed files as domain objects.
- Define the physical storage contract through
FileStorage. - Provide
LocalFileStorageas the initial storage implementation. - Persist file metadata through
FileModelandFileRepository. - Coordinate operations spanning persistence and physical storage through
FileManager. - Distinguish archiving a file from permanently purging its physical contents.
Architecture
File (domain object)
|
| storage_key
v
FileStorage
|
+--> LocalFileStorage
|
v
Physical file bytes
File
|
v
FileRepository
|
v
FileModel (Django persistence)
Domain object
File represents CMS-level identity and metadata, including its ID, name, MIME type, size, storage key, status, metadata, and timestamps. It does not depend on Django or a particular storage backend, and it does not contain the file bytes.
Storage
FileStorage is an abstract base class defining the storage operations:
save()delete()exists()open()url()
LocalFileStorage is the initial concrete implementation. Storage keys are relative to the configured root and must not escape that root through path traversal.
Persistence
FileModel is the Django persistence representation of the file metadata. It does not use Django's FileField to manage physical storage.
FileRepository translates between File and FileModel. It owns persistence operations and does not manipulate physical file contents.
Coordination
FileManager coordinates operations that involve both physical storage and persistence. For example, file creation stores the bytes and then persists metadata; if persistence fails, the manager attempts compensating cleanup of the stored file.
Lifecycle
The current lifecycle distinguishes:
ACTIVEARCHIVED- Purging as a separate physical deletion operation
Archiving removes a file from active CMS use without immediately deleting its bytes.
Configuration
This package has the file_repository and file_manager accessible trhough its application definition.
Architectural integrations
| Package / system | Relationship |
|---|---|
| Django | Persistence model and database operations |
mcms_core |
Shared infrastructure and exception conventions |
| Host application | Supplies storage root/base URL configuration and Django app setup |
Explicitly excluded from the current architecture
- A
FileRegistry - A generic
FileServicelayer - Django
FileFieldas the physical storage mechanism - Immediate physical deletion when a file is archived
S3/object storage, cleanup of archived files, orphan detection, deduplication, versioning, transformations, chunked uploads, permissions, CDN integration, and quotas are future considerations rather than current guarantees.
Dependencies
Architectural integrations
The domain model is independent of Django and storage infrastructure. The repository owns persistence; the storage implementation owns physical bytes; the manager coordinates cross-boundary operations.
Python distribution dependencies
All MCMS Packages rely on django
Development
uv run pytest packages/mcms-files/tests
Run Ruff and mypy using the repository's configured commands.
Metadata
Release files for mcms-files 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcms_files-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcms_files-0.1.0-py3-none-any.whl |
Release files / mcms_files-0.1.0-py3-none-any.whl
| Download URL | mcms_files-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae3a76d5e3aebd0f2be29a3e7d3b8689677066354b4c066debd43ff0f7c2002f
|
|
BLAKE2b-256 checksum How to use checksums |
c24d7e74f539de18c911aa9590d404712d94d81924a2b1e8aa6e1cc05db1a03d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"21.3","id":"virginia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mcms-files 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.