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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_class_registry-1.1.2.tar.gz.
File metadata
- Download URL: django_class_registry-1.1.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
890e7da18894d6403f5c7b72699a375b3615ae01f77b4cfdde999f787bdcc374
|
|
| MD5 |
fbd5224fea91ee2904e7aee63b887e4b
|
|
| BLAKE2b-256 |
f6e5f67ef17a5d4dfbc1579243858b7f23b03cc7cd656da6004be390f8ea2e13
|
File details
Details for the file django_class_registry-1.1.2-py3-none-any.whl.
File metadata
- Download URL: django_class_registry-1.1.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bce5a2525876bdf54e4fe8a0ea02a3c044205414e5e46bc4239c2fb334a8c68
|
|
| MD5 |
490eeeaea7d50ed4affa8f9503349a95
|
|
| BLAKE2b-256 |
ac37be41683fe1fb3142138ad6d5143bad7610e9c7179152e163002ecf684479
|