Features
**1. Core Framework Enhancements**
- **MultipartPacker Implementation**:
Introduced a specialized `MultipartPacker` to streamline handling of `multipart/form-data` requests, commonly used for file uploads.
- Extracts file data into a structured dictionary, with files mapped by their part names.
- Includes a `_multipart` flag to explicitly indicate multipart content processing.
- Designed for future extensibility (e.g., potential support for model JSON alongside files).
**2. Model Layer Improvements**
- **Base Model Classes**: Added reusable base models to encapsulate common fields and behaviors:
- **`ModelWithTimestamp`**: Automatically manages `created_at` and `updated_at` UTC timestamps on creation/update.
- **`ModelWithProject`**: Enforces immutable `project_id` for tenant-scoped resources.
- **`ModelWithNameDesc`**: Standardizes `name` and `description` fields (max 255 chars, empty string defaults).
- Promotes modularity, reduces redundancy, and simplifies future model development.
---
Improvements
**1. Routing System Refactor**
- **Base Controller for Route Filtering**:
- Created `RoutesListController` base class to centralize route discovery logic.
- Scans nested routes via `_get_target_route()` using `__TARGET_PATH__`.
- Filters collection routes using `is_collection_route()` checks.
- **Adopted in Controllers**:
- `RootController` and test `V1Controller` now inherit from `RoutesListController`, eliminating duplicate filtering code.
- **Testing Updates**:
- Expanded `TestVersionsResourceTestCase` to verify detection of multiple collection routes (e.g., `["notimplementedmethods", "vms"]`).
---
Implementation Notes
- **Routing**: Configure `__TARGET_PATH__` in controllers to define the root path for automatic route scanning.
- **Models**: Inherit from base models to leverage standardized fields and behaviors while minimizing boilerplate.
- **File Handling**: Use `MultipartPacker` to simplify file upload processing in API endpoints.
This release enhances maintainability, reduces code duplication, and provides foundational components for consistent API routing, model management, and file handling.