django-modeldict

Software Screenshot:
django-modeldict
Software Details:
Version: 1.3.5
Upload Date: 20 Feb 15
Developer: Disqus
Distribution Type: Freeware
Downloads: 11

Rating: nan/5 (Total Votes: 0)

django-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
>>> 'foo'

settings['foo']
>>> 'foo'

Requirements:

  • Django
  • Python

Other Software of Developer Disqus

nose-performance
nose-performance

20 Feb 15

django-bitfield
django-bitfield

14 Apr 15

Zumanji
Zumanji

20 Feb 15

Comments to django-modeldict

Comments not found
Add Comment
Turn on images!