Models¶
DRF Toolkit provides enhanced model functionality through various base classes and mixins. Each model type serves a specific purpose and can be combined with others to create more complex functionality.
Available Models¶
Base Models¶
- Base Models - Core functionality and timestamp tracking
- Diff Models - Track field changes in models
Feature Models¶
- Availability Models - Time-based availability management
- File Models - File handling and storage
- Inheritance Models - Model inheritance capabilities
- Ordered Models - Ordered item management
- Soft Delete Models - Soft deletion functionality
Combined Models¶
For more complex use cases, these models can be combined. See Model Combinations for examples and best practices.
Best Practices¶
- Always inherit from the appropriate base model for your use case
- Use the provided model managers for consistent behavior
- Consider using soft delete when data history is important
- Leverage the diff tracking for audit logs and change tracking
- Combine models thoughtfully to avoid complexity
For detailed documentation on each model type, click the respective links above.