Skip to content

Commit

Permalink
Allow passing all DashboardModule kwargs in `FLUENT_DASHBOARD_APP_G…
Browse files Browse the repository at this point in the history
…ROUPS`.
  • Loading branch information
vdboor committed Apr 15, 2014
1 parent 7b0ed83 commit ffba276
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,10 @@
Changes in version 0.4.0
------------------------

* Allow passing all ``DashboardModule`` kwargs to ``FLUENT_DASHBOARD_APP_GROUPS``.
* Fix assumption that varnish_ is installed because dashboardmods_ is.


Changes in version 0.3.6
------------------------

Expand Down Expand Up @@ -88,3 +95,5 @@ Initial internal release

.. _django-admin-tools: https://bitbucket.org/izi/django-admin-tools/wiki/Home
.. _django-fluent-contents: https://github.com/edoburu/django-fluent-contents
.. _dashboardmods: https://github.com/callowayproject/dashboardmods
.. _varnish: https://github.com/justquick/python-varnish_
14 changes: 9 additions & 5 deletions fluent_dashboard/appgroups.py
Expand Up @@ -32,20 +32,24 @@ def get_application_groups():

groups = []
for title, groupdict in appsettings.FLUENT_DASHBOARD_APP_GROUPS:
if '*' in groupdict['models']:
# Allow to pass all possible arguments to the DashboardModule class.
# However, the 'models' is treated special, to have catch-all support.
models = groupdict['models']
module_kwargs = groupdict.copy()

if '*' in models:
default_module = appsettings.FLUENT_DASHBOARD_DEFAULT_MODULE
module_kwargs = {'exclude': ALL_KNOWN_APPS}
module_kwargs['exclude'] = ALL_KNOWN_APPS
del module_kwargs['models']
else:
default_module = 'CmsAppIconList'
module_kwargs = {'models': groupdict['models']}
module_kwargs['models'] = models

# Get module to display, can be a alias for known variations.
module = groupdict.get('module', default_module)
if MODULE_ALIASES.has_key(module):
module = MODULE_ALIASES[module]

module_kwargs['module'] = module
module_kwargs['collapsible'] = groupdict.get('collapsible', False)
groups.append((title, module_kwargs),)

return groups
Expand Down

0 comments on commit ffba276

Please sign in to comment.