Skip to content

Instantly share code, notes, and snippets.

@sivy
Created February 6, 2015 15:23
Show Gist options
  • Save sivy/c7819ac97b52cb3292af to your computer and use it in GitHub Desktop.
Save sivy/c7819ac97b52cb3292af to your computer and use it in GitHub Desktop.
[Fri Feb 06 14:29:06.602584 2015] [:error] tables.DataTableView.__init__(self, workflow.request)
[Fri Feb 06 14:29:06.602613 2015] [:error] File "/usr/lib/python2.7/dist-packages/horizon/tables/views.py", line 29, in __init__
[Fri Feb 06 14:29:06.602642 2015] [:error] super(MultiTableMixin, self).__init__(*args, **kwargs)
[Fri Feb 06 14:29:06.602670 2015] [:error] TypeError: __init__() takes exactly 1 argument (2 given)
(
<class 'pce_project_attributes.overrides.workflows.CustomAttributesStep'>,
<class 'pce_project_attributes.overrides.workflows.DataTableStep'>,
<class 'horizon.workflows.base.Step'>,
<class 'horizon.tables.views.DataTableView'>,
<class 'horizon.tables.views.MultiTableView'>,
<class 'horizon.tables.views.MultiTableMixin'>, ### DIES
<class 'django.views.generic.base.TemplateView'>,
<class 'django.views.generic.base.TemplateResponseMixin'>,
<class 'django.views.generic.base.ContextMixin'>,
<class 'django.views.generic.base.View'>, <type 'object'>
)
class MultiTableMixin(object):
"""A generic mixin which provides methods for handling DataTables."""
data_method_pattern = "get_%s_data"
def __init__(self, *args, **kwargs):
super(MultiTableMixin, self).__init__(*args, **kwargs)
# [...]
class MultiTableView(MultiTableMixin, generic.TemplateView):
pass # no __init__()
class DataTableView(MultiTableView):
pass # no __init__()
class Step(object):
def __init__(self, workflow):
super(Step, self).__init__()
# [...]
class DataTableStep(workflows.Step, tables.DataTableView):
"""
A Workflow step that can show a (potentially editable) DataTable.
All the real work happens in the subclass, but this sets up the
inheritance.
"""
contributes = () # nada, zilch, bupkiss
def __init__(self, workflow):
print self.__mro__
super(DataTableStep, self).__init__(workflow)
tables.DataTableView.__init__(self, workflow.request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment