Django-ninja-crud

Latest version: v0.6.2

Safety actively analyzes 682430 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.3.3

**Date:** October 13, 2023

✨ New Features

- **Pagination Control**: Added option to `disable` or `override` the default `LimitOffsetPagination` class (254).

πŸ“š Documentation

- **Type Hint Corrections**: Corrected `Optional` type hints in `docstrings` for accuracy and clarity (256).

0.3.2

**Date:** October 8, 2023

✨ New Features

- **Router Parameters Override**: added support for overriding `summary`, `operation_id` and most importantly `path` (236, 241).

πŸ›  Refactoring

- **Test Framework**: moved `HTTPStatus` checks into `RequestComposer` class and renamed `RequestComposer` to `TestComposer` (232, 234).
- **Abstract Model View**: generalized `method`, `path` and `detail` attributes to `AbstractModelView` (241, 247).

πŸ„β€β™‚οΈ Code Quality

- **PEP 484**: made `Optional` type hints `explicit` according to PEP 484 (243).

0.3.1

**Date:** September 5, 2023

πŸ›  Refactoring

- **Rename Test Classes**: All test classes have been renamed to follow Python unittest conventions by having "Test" as a prefix. This change comes with deprecation warnings for the old class names (222).

πŸ› Bug Fixes

- **TestModelViewSetMeta Error Message**: Improved the error message in `TestModelViewSetMeta` to be more informative when the class is not subclassed from `TestCase` (228).

πŸ“š Documentation

- **Contribution Guidelines**: Updated `CONTRIBUTION.md` to provide better clarity for potential contributors (217).
- **README and Examples**: Updated `README.md` and `04-Examples.md` for the `v0.3.1` release, including new changes (226).

---

πŸ“£ Note
This is a minor release that includes important refactoring. Existing users are encouraged to update to this version for a smoother development experience. Note that the test class renaming includes deprecation warnings for the old class names, so it's important to transition to the new naming convention.

0.3.0.post1

**Date:** August 24, 2023

πŸ“š Documentation

- **README Logo on PyPI**: Fixed the relative path to the project logo in the README to ensure it displays correctly on PyPI (196).

---

πŸ“£ Note
This is a non-functional change and does not affect the library's behavior or performance. Existing users do not need to update unless they specifically wish to see the corrected documentation on PyPI.

0.3.0

**Date:** August 24, 2023

I'm excited to introduce version v0.3.0 of Django Ninja CRUD. This release has been one of my most ambitious, encompassing approximately 70 pull requests filled with new features, refinements, fixes, and more. Here's a breakdown of what's new:

🌟 Highlights

- **Revamped Test Suite**: Undertook a major overhaul of the test suite to introduce new components like `RequestComposer` and enforce `TestCase` inheritance for `ModelViewSetTest` subclasses. These changes bring robustness and intuitiveness to our testing environment.

- **Introduction of `PartialUpdateModelView`**: The new `PartialUpdateModelView` class allows for more precise updates, simplifying and enhancing your data manipulation workflows (85, 129).

- **UX-Focused List and Create Model Views**: Improved user experience by adopting Django's `verbose_name` in list and create views, making the interface more readable and user-friendly (167).

- **Comprehensive Refactoring**: Conducted a sweeping code clean-up and restructuring for improved maintainability and future development.

- **First Complete Version of View Documentation**: Accomplished a significant milestone by providing comprehensive documentation for all views, serving as a detailed guide for users and contributors alike ([available here](https://github.com/hbakri/django-ninja-crud/wiki)).

✨ New Features

- **Old Instance Parameter in Save Hooks**: Added `old_instance` parameter to `pre_save` and `post_save` hooks for more complex business logic during save operations (45).
- **List Type Support for Testing Suite**: Enhanced the testing suite to support attributes of the list type (47).
- **Views and Tests Matching Validation**: Introduced validation to ensure that for each view, a corresponding test exists (70).
- **TestCase Enforced for `ModelViewSetTest` Subclasses**: Now requiring that any subclass of `ModelViewSetTest` must also inherit from Django's `TestCase` (73).
- **Type Verification for Test Class Attributes**: Implemented type verifications for `ModelViewSetTest` class attributes to ensure robust and reliable tests (81).
- **Partial Updates with `PartialUpdateModelView `**: Enabled partial updates to models using the new `PartialUpdateModelView ` class (85, 129).
- **Type Verification for `ModelViewSet` Class Attributes**: Added type verifications to ensure runtime safety and reduce errors due to type mismatches (90).
- **Router Customization via `router_kwargs`**: Introduced the `router_kwargs` attribute for customizing Django Ninja's `Router` attributes, providing more control over API routes (93).
- **Custom Queryset Validation in Retrieve View**: Added `queryset_getter` validator for `RetrieveModelView` for more complex queries and added validation (157).
- **User-Friendly Model Naming in List and Create Views**: Switched to using Django's `verbose_name` for a more readable and user-friendly presentation in list and create views (167).

πŸ› οΈ Refactorings

- **Codebase Organization and File Structure**: Split `AbstractModelView` and `ModelViewSet` classes into separate files to enhance code organization (71, 54).
- **Improvements in Test Class Definitions**: Introduced `RequestComposer` and `TestAssertionHelper` for a more robust and comprehensive testing environment, and employed attribute names for unique test method naming in `ModelViewSetTest` (49, 80, 57, 54, 52, 77, 78).
- **Attribute Renaming and Removal for Test Classes**: Removed redundant attributes like `client`, `name`, `model_view_set_class`, and `urls_prefix` from `AbstractModelViewTest`, and renamed attributes to better reflect their roles such as changing `test_case` to `model_view_set_test` (60, 58, 78, 77).
- **Url Prefix and Base Path Terminology**: Renamed methods and attributes related to URL prefixes to align with the more general term `base_path` (89, 87).
- **Schema Definitions and Type Handling**: Added and renamed various type aliases for better code readability and context understanding, and renamed schema generation methods to better reflect their functionalities (181, 146, 148, 130).
- **Streamlining of Model Views**: Removed redundant and unused attributes and methods such as `related_model`, and introduced new methods like `_configure_route` and `_save_model` for better code separation (172, 154, 169, 137, 135).
- **Clarity in Naming and Functionality**: Renamed several key attributes and methods, such as `instance_builder` to `model_factory`, to provide a more intuitive understanding (190, 129, 61).

πŸ› Bug Fixes

- **Badge URL in README**: Fixed the downloads badge URL in README (156).
- **Guide File Order in Documentation Sidebar**: Resolved an issue where the files in the documentation sidebar were not in the correct order (124).
- **Type Annotation for `model_view_set_class` Attribute**: Fixed incorrect type annotations for the `model_view_set_class` attribute in `ModelViewSetTest` class (68).
- **Save and Delete Hooks Typing**: Resolved type-related issues in the `save` and `delete` hooks to improve code quality and reliability (44).

πŸ“š Documentation

- **Updated README**: The README has been updated to reflect the latest changes and offer clearer guidance (193, 185).
- **In-depth View Docstrings**: Improved and added detailed docstrings for various views, enhancing the inline documentation (180, 178, 174, 164, 162, 159, 110, 109, 108).
- **Home Page Documentation**: Added a Home page to the documentation (183).

πŸ™ Acknowledgments

Up until this point, the journey of developing and maintaining this open-source package has been a solo endeavor. However, the essence of open-source is community, and I'm elated to announce that this release marks a significant milestoneβ€”our community is growing!

Welcome New Contributors!

In this release, I'm honored to welcome our very first external contributors to the project. Your active involvement not only enriches the codebase but also amplifies the spirit of collaborative development.

- **chengfangho**: Your refactoring, which renamed the `ModelViewSet` class attribute from `model` to `model_class`, has made the code more maintainable and intuitive (61).

- **lucasrcezimbra**: Your feature introducing `router_kwargs` adds a new layer of customization and flexibility to Django-Ninja's Router attributes. This is a critical enhancement that users will find extremely beneficial (93).

- **kuramen**: And a special acknowledgment goes to my friend and colleague, who made the project more visually engaging by integrating both the project and Django-Ninja logos into our README. Kuramen, your creative touch inspired the idea for the logo and made a significant impact on how newcomers perceive our project (92).

New contributors, your additions are invaluable and warmly welcomed. The project is all the richer for your involvement, and I'm eager to see how your future contributions will continue to enhance our growing community.

0.2.0

Added
- support every `pk` type, and support callable `params` in tests. (24)
- create `CONTRIBUTING.md` (29)

Changed
- drop support for python `3.7`. (32)
- refactor `params` objects in tests. (36)

Fixed
- remove `Callable` warnings. (26)
- use `pk` instead of `id` in views. (31)
- raise `404` for non-existing `id` on detail views. (33)

Page 2 of 3

Β© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.