django-preferences

Software Screenshot:
django-preferences
Software Details:
Version: 0.0.6
Upload Date: 14 Apr 15
Distribution Type: Freeware
Downloads: 53

Rating: nan/5 (Total Votes: 0)

django-preferences is a Django application that allows users to set app specific preferences through the admin interface.

Provides singleton admin views for Preferences objects and a simple interface to preference values. Singleton views ensures only one preference intance is available for each Preferences class.

Installation

 1. Add preferences to your INSTALLED APPS setting.
 2. Add preferences url include to the project's url.py file. Make sure to use 'admin/' as the start of the include's path since it will override certain admin views:

 (r'^admin/', include('preferences.urls')),

Usage

To create preferences for your app create a model storing your preferences as normal, with the model inheriting from preferences.models.Preferences. Also specify preferences.models as your models module:

from django.db import models
from preferences.model import Preferences

class MyPreferences(Preferences):
 __module__ = 'preferences.models'
 portal_contact_email = models.EmailField()

Admin classes are specified as per usual, no changes are needed. Your preferences will show up under the Preferences app label in Django admin.

Preferences can be accessed in python by importing the preferences module and traversing to your required preferences in the form preferences.< ModelName >.< field >, i.e.:

from preferences import preferences

portal_contact_email = preferences.MyPreferences.portal_contact_email

What is new in this release:

  • Better packaging.

What is new in version 0.0.5:

  • Added sites support.
  • Added unittests.

What is new in version 0.0.4:

  • Cleanup. Docs polish.

What is new in version 0.0.3:

  • Spelling correction, thanks tiktuk.

Requirements:

  • Python
  • Django

Other Software of Developer Praekelt Foundation

django-gizmo
django-gizmo

20 Feb 15

holodeck
holodeck

20 Feb 15

jmbo-skeleton
jmbo-skeleton

20 Feb 15

Comments to django-preferences

Comments not found
Add Comment
Turn on images!