This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Stores a model as a dictionary

Project Description

ModelDict is a very efficient way to store things like settings in your database. The entire model is transformed into a dictionary (lazily) as well as stored in your cache. It’s invalidated only when it needs to be (both in process and based on CACHE_BACKEND).

Quick example usage. More docs to come (maybe?):

class Setting(models.Model):
    key = models.CharField(max_length=32)
    value = models.CharField(max_length=200)
settings = ModelDict(Setting, key='key', value='value', instances=False)

# access missing value
settings['foo']
>>> KeyError

# set the value
settings['foo'] = 'hello'

# fetch the current value using either method
Setting.objects.get(key='foo').value
>>> 'hello'

settings['foo']
>>> 'hello'
Release History

Release History

This version
History Node

1.4.1

History Node

1.3.6

History Node

1.3.5

History Node

1.3.4

History Node

1.3.3

History Node

1.3.2

History Node

1.3.1

History Node

1.3.0

History Node

1.2.0

History Node

1.1.6

History Node

1.1.5

History Node

1.1.4

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.1

History Node

1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-modeldict-1.4.1.tar.gz (10.6 kB) Copy SHA256 Checksum SHA256 Source Dec 4, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting