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.
python
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](https://danialkeimasi.github.io/python-registerer/) are available now. For more information, check it out.
**Full Changelog**: https://github.com/danialkeimasi/python-registerer/compare/v0.5.0...v0.6.0