Esempio n. 1
0
 def get_transition_choices(self):
     choices = OrderedDict()
     for transition in OrderModel.get_all_transitions():
         if transition.target:
             transition_name = OrderModel.get_transition_name(
                 transition.target)
             choices[transition.target] = transition_name
     return choices.items()
Esempio n. 2
0
 def get_transition_choices(self):
     choices = OrderedDict()
     for transition in OrderModel.get_all_transitions():
         if isinstance(transition.target, six.string_types):
             choices[transition.target] = OrderModel.get_transition_name(transition.target)
         elif isinstance(transition.target, RETURN_VALUE):
             for target in transition.target.allowed_states:
                 choices[target] = OrderModel.get_transition_name(target)
     return choices.items()
Esempio n. 3
0
 def get_transition_choices(self):
     choices = OrderedDict()
     status_field = [f for f in OrderModel._meta.fields if f.name == 'status'].pop()
     for transition in status_field.get_all_transitions(OrderModel):
         if transition.target:
             transition_name = OrderModel.get_transition_name(transition.target)
             choices[transition.target] = transition_name
     return choices.items()
Esempio n. 4
0
 def get_transition_choices(self):
     choices = OrderedDict()
     status_field = [
         f for f in OrderModel._meta.fields if f.name == 'status'
     ].pop()
     for transition in status_field.get_all_transitions(OrderModel):
         if transition.target:
             transition_name = OrderModel.get_transition_name(
                 transition.target)
             choices[transition.target] = transition_name
     return choices.items()
Esempio n. 5
0
 def transition_name(self, obj):
     return OrderModel.get_transition_name(obj.transition_target)
Esempio n. 6
0
 def transition_name(self, obj):
     return OrderModel.get_transition_name(obj.transition_target)