Register any classes like Django's admin.
Project description
Allows you to create any Registry, similar to how django’s admin has you register classes, or their template library has you register tags.
Usage
from class_registry import Registry site = Registry() @site.register class MyCoolClass(object): """ My class that should be registered. """ key = "ABC" >>> site["ABC"] <class 'MyCoolClass'>
Alternate use
Or, if you want your own key name, specify it when you register the class.:
container = Registry(key_name="other_key") @container.register class MyCoolClass(object): other_key = "POL-COOL-CLS"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-class-registry-0.0.3.tar.gz
.
File metadata
- Download URL: django-class-registry-0.0.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0fbfb13a31f0b2a30248b04399824cbf31e37b6528c3679fa702267456cbbaa |
|
MD5 | 1d2317c78fec0e0691d48eae89c62a4a |
|
BLAKE2b-256 | 2cb9533e392e5966af3f01e41c795dcd5bdd30ced31a82225ff115013b480e3d |