Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Process' object has no attribute 'all_transitions' #28

Closed
Blackeagle52 opened this issue Nov 5, 2012 · 2 comments
Closed

Comments

@Blackeagle52
Copy link

Hi there,

I get an AttributeError: 'Process' object has no attribute 'all_transitions', I tried to find the error myself, but I failed to understand the whole structure.

Some extra information about the creation of the error.

>>> from module.models import Process
>>> p = Process.objects.get(id=2)
>>> p
<Process: Process 2 (proces gestart)>
>>> p.state_description
u'proces gestart'
>>> p.state_transitions.all()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/peterpul/VirtualEnvs/lp_traject/src/states2/states2/models.py", line 100, in state_transitions
    return self.get_state_transitions()
  File "/Library/Python/2.7/site-packages/django/utils/functional.py", line 11, in _curried
    return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
  File "/Users/peterpul/VirtualEnvs/lp_traject/src/states2/states2/model_methods.py", line 19, in get_STATE_transitions
    return self.all_transitions.all()
AttributeError: 'Process' object has no attribute 'all_transitions'

Where

class Process(StateModel):
    """ ofcourse some attributes """

    class Meta:
        app_label = 'module'
        verbose_name = _('process')
        verbose_name_plural = _('processes')

    class Machine(StateMachine):
        log_transitions = True

        class initiated(StateDefinition):
            description = _('process initiated')
            initial = True

        class process_started(StateDefinition):
            description = _('process started')

        class start_process(StateTransition):
            from_state = "initiated"
            to_state = "process_started"
            description = _("Start up the process")

        """Followed by some more states and transitions""""

Edit;
Maybe interesting too;

>>> Process.state_transitions
<property object at 0x10baebfc8>
@meizon
Copy link
Contributor

meizon commented Dec 31, 2012

I have this same issue.

@jonathanslenders
Copy link
Contributor

Fixed. Thanks to rh0dium!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants