Possible issue with dashboard __init__ function definitions?

Issue #4 duplicate
Dana Spiegel
created an issue

I'm seeing an issue that may or may not be a bug (I'm not sure). When I install the admin_tools app, I get an exception: {{{


Original Traceback (most recent call last): File "/Library/Python/2.6/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File "/Library/Python/2.6/site-packages/django/template/init.py", line 936, in render dict = func(*args) File "/Users/dana/Source/cathedralpartners/platform/lib/admin_tools/dashboard/templatetags/dashboard_tags.py", line 61, in render_dashboard_css dashboard = get_dashboard_from_context(context) File "/Users/dana/Source/cathedralpartners/platform/lib/admin_tools/dashboard/utils.py", line 38, in get_dashboard_from_context return get_app_index_dashboard(app_label, app_title, models) File "/Users/dana/Source/cathedralpartners/platform/lib/admin_tools/dashboard/utils.py", line 85, in get_app_index_dashboard return getattr(mod, inst)(app_title, model_list) TypeError: init() takes exactly 1 argument (3 given) }}}

It seems the issue might be that the init() function is defined in a non-standard way (though again, I'm not sure). I've always defined/overridden init using the following signature: {{{


init(self, args, *kwargs) }}} whereas the current definition in {{{dashboard/models.py}}} objects is: {{{


init(self, **kwargs) }}}

Changing the code in these class definitions to the version with {{{*args}}} seems to resolve the issue.

Comments (1)

  1. Log in to comment