Registerer

Latest version: v0.7.0

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

Scan your dependencies

Page 1 of 2

0.7.0

Update Notes
- Just rename `represent` to `attrs_as_tuples`.

**Full Changelog**: https://github.com/danialkeimasi/python-registerer/compare/v0.6.0...v0.7.0

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.

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

0.5.0

**Full Changelog**: https://github.com/danialkeimasi/python-registerer/compare/v0.4.3...v0.5.0

0.4.3

**Full Changelog**: https://github.com/danialkeimasi/python-registerer/compare/v0.4.0...v0.4.3

0.4.0

API Improvements.

0.3.1

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.