Plugin preferences
Every Plugin can have his own
Preferences. The admin can easy setup the
preferences for all plugins with the preferences editor .
Preferences are defined as a django newforms class with initial values .
The newforms class must be inserted in the plugin config file and must be named 'PreferencesForm'.
There are two way to access the
preferences:
- Access the
preferences on module level (use in a newform class)
- Access only in the plugin class
This is the easiest way:
You should use this access way only if it really needed. You need this e.g. if you use
preferences value in a newform class:
The
preferences saved into the plugin model. A low level access looks like this: