example addon in README.rst for BLOG_ADMIN_POST_FIELDSET_FILTER usage
This commit is contained in:
parent
a315e1c3f8
commit
2aa52b16bb
1 changed files with 5 additions and 1 deletions
|
|
@ -352,7 +352,11 @@ Global Settings
|
||||||
* BLOG_DEFAULT_PUBLISHED: If posts are marked as published by default;
|
* BLOG_DEFAULT_PUBLISHED: If posts are marked as published by default;
|
||||||
(default: ``False``)
|
(default: ``False``)
|
||||||
* BLOG_ADMIN_POST_FIELDSET_FILTER: Callable function to change(add or filter)
|
* BLOG_ADMIN_POST_FIELDSET_FILTER: Callable function to change(add or filter)
|
||||||
fields to fieldsets for admin post edit form; (default: ``False``)
|
fields to fieldsets for admin post edit form; (default: ``False``). Function simple example:
|
||||||
|
def fieldset_filter_function(fsets, request, obj=None):
|
||||||
|
if request.user.groups.filter(name='Editor').exists():
|
||||||
|
fsets[1][1]['fields'][0].append('author') # adding 'author' field if user is Editor
|
||||||
|
return fsets
|
||||||
* BLOG_AVAILABLE_PERMALINK_STYLES: Choices of permalinks styles;
|
* BLOG_AVAILABLE_PERMALINK_STYLES: Choices of permalinks styles;
|
||||||
* BLOG_PERMALINK_URLS: URLConf corresponding to
|
* BLOG_PERMALINK_URLS: URLConf corresponding to
|
||||||
BLOG_AVAILABLE_PERMALINK_STYLES;
|
BLOG_AVAILABLE_PERMALINK_STYLES;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue