El 07/11/13 09:34, Jesús Martín Jiménez ha escrit:
2013/11/6 Sergi Almacellas Abellana <[email protected]
<mailto:[email protected]>>
Hi devs,
I'm developing a Wizard mixin like:
class OpenExecutionMixin(Wizard):
start = StateTransition()
def transition_start(self):
print 'start %s' % self.__name__
return 'end'
class OpenExecution(OpenExecutionMixin):
'Open Report Execution'
__name__ = 'report.execution.open'
start = StateTransition()
def transition_start(self):
print 'start %s' % self.__name__
return 'end'
class OpenExecutionButton(OpenExecutionMixin):
'Open Report Execution'
__name__ = 'report.execution.open.button'
start = StateTransition()
def transition_start(self):
print 'start %s' % self.__name__
return 'end'
But whenever I call a one of the wizards the client executes both
wizards. When i execute the second wizard the output is the following:
start report.execution.open.button
start.report.execution.open
Why is first wizard called? It's a bug or I am doing something wrong?
It is weird that point between start and report of the second line.
Have you tried to delete the pyc file?
The reason that I need a mixin was to execute diferent code depending if
it's called from two diferent models. So I have solved the problem by
using Transaction().context('active_model') to alter the behaviour of
the wizard.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk