Statemachine should not store obj instance on State #41

andrewebdev opened this Issue Jun 17, 2014 · 0 comments


None yet
1 participant

andrewebdev commented Jun 17, 2014

Currently the model instance is stored on every State as instance. Rather, what should happen is that the instance is passed as a argument to the state action.

This allows us to use a shorter syntax and avoid possible pitfalls when the item is stored on the State.

For example the following code:

class SomeState(State):
    def some_action(self, **kwargs):
        self.instance.some_attr = 'A new Value'

will become this:

class SomeState(State):
    def some_action(self, obj, **kwargs):
        obj.some_attr = 'A new value'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment