Releases: danialkeimasi/python-registerer
Releases · danialkeimasi/python-registerer
Version 1.0.0
Release Notes: v1.0.0 (from v0.7.0)
- Breaking: Drop Python 3.7 and 3.8; require Python 3.9+.
- Modernized type hints (PEP 585):
list[...],dict[...],type[T]. - Improved validator error message clarity.
- CI/CD: Test on 3.9–3.13; auto-build and publish to PyPI on tags.
Full Changelog: v0.7.0...v1.0.0
Version 0.7.0
Version 0.6.0
This version is backward compatible mostly and there is no breaking API changes.
Whats New
Introduced new methods on Registerer class:
represent(*args)
Use this to create a representation of registered items. You can use this to create choices for Django model field.
The input name of attrs you have on registered items. The output is a list of lists that represents the values of attrs.
registry = registerer.Registerer()
@registry.register()
class ContestStep:
slug = "contest"
name = "Contest"
@registry.register()
class CollegeStep:
slug = "college"
name = "College"
assert registry.represent("slug", "name") == [["contest", "Contest"], ["college", "College"]]
class Step(django.db.models.Model):
step_slug = models.CharField(max_length=100, choices=registry.represent("slug", "name"))unregister(registry_slug)
Unregister the item with given slug.
get(registry_slug, default=None)
Return the value for key if key is in the registry, else default.
Docs
The new docs are available now. For more information, check it out.
Full Changelog: v0.5.0...v0.6.0
Version 0.5.0
Full Changelog: v0.4.3...v0.5.0
Version 0.4.3
Full Changelog: v0.4.0...v0.4.3
Version 0.4.0
API Improvements.
Version 0.3.1
v0.3.1 Bump version 0.3.1
Version 0.3.0
Version 0.2.1
Version 0.1.5
v0.1.5 Update README.md and Bump v0.1.5