added file upload storage and versions metadata for FileVersion model#37
Open
zainabbaker290 wants to merge 4 commits into
Open
added file upload storage and versions metadata for FileVersion model#37zainabbaker290 wants to merge 4 commits into
zainabbaker290 wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds upload/download support and version metadata for the FileVersion model, exposing new REST endpoints to upload files and retrieve stored document revisions.
Changes:
- Extend
FileVersionwith storage + metadata fields and auto-incrementing version logic. - Add endpoints for uploading files (
/api/file_versions/,/api/documents/<path>) and retrieving a specific revision via?revision=.... - Expand test coverage around upload, version increments, and revision retrieval.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_file_versions.py | Adds API-level tests for uploads, multi-version behavior, and revision retrieval. |
| tests/factories.py | Adjusts typing imports used by test factories. |
| tests/conftest.py | Ensures Django is configured for pytest and enables DB/media storage fixtures for tests. |
| src/propylon_document_manager/site/urls.py | Registers the new catch-all /api/documents/<path:url_path> routes and media URL handling. |
| src/propylon_document_manager/site/api_router.py | Updates router imports for the file version API. |
| src/propylon_document_manager/file_versions/models.py | Extends FileVersion schema and implements version auto-increment + ordering. |
| src/propylon_document_manager/file_versions/migrations/0002_fileversion_storage_fields.py | Adds new storage/metadata fields and updates version_number type/default. |
| src/propylon_document_manager/file_versions/migrations/0003_alter_fileversion_options.py | Adds default ordering on uploaded_at/version_number. |
| src/propylon_document_manager/file_versions/api/views.py | Implements upload/download behavior including revision selection. |
| src/propylon_document_manager/file_versions/api/serializers.py | Adds upload-aware serializer fields and create logic for uploads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…o added CAS retrieval endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
now able to upload and get files
upload handles any type of files and multiples of the same files
Get returns file metadata in json format