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"

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.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file django_class_registry-1.1.3.tar.gz.

File metadata

  • Download URL: django_class_registry-1.1.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for django_class_registry-1.1.3.tar.gz
Algorithm Hash digest
SHA256 ef3817cb08c1d8d3fca9786f4525117ab4b81530d5c2d47c030a0f2530073700
MD5 61e02af93474acef814c4594921f85a5
BLAKE2b-256 8d938ea452de5c8273998d5d0224201aba18109096b96a6daddd320cea3c7630

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_class_registry-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b356ead3953df9037dc3ea2ee42ef9543d44c17789b308f0a0bd162898cb8ebf
MD5 22fe1332275f3478abf48adf4fba482f
BLAKE2b-256 4c9de9f3b2c7908f836295a5a6a33f9056a947fdda1bcf8b472ba9f4019606d6

See more details on using hashes here.

Supported by

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