Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

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

This version
History Node

0.0.3

History Node

0.0.2

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-class-registry-0.0.3.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None Jan 23, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page