Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_class_registry-1.1.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

django_class_registry-1.1.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

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

Hashes for django_class_registry-1.1.2.tar.gz
Algorithm Hash digest
SHA256 890e7da18894d6403f5c7b72699a375b3615ae01f77b4cfdde999f787bdcc374
MD5 fbd5224fea91ee2904e7aee63b887e4b
BLAKE2b-256 f6e5f67ef17a5d4dfbc1579243858b7f23b03cc7cd656da6004be390f8ea2e13

See more details on using hashes here.

File details

Details for the file django_class_registry-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_class_registry-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bce5a2525876bdf54e4fe8a0ea02a3c044205414e5e46bc4239c2fb334a8c68
MD5 490eeeaea7d50ed4affa8f9503349a95
BLAKE2b-256 ac37be41683fe1fb3142138ad6d5143bad7610e9c7179152e163002ecf684479

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page