Ejemplo 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()
Ejemplo 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()
Ejemplo 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()
Ejemplo 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()
Ejemplo n.º 5
0
 def transition_name(self, obj):
     return OrderModel.get_transition_name(obj.transition_target)
Ejemplo n.º 6
0
 def transition_name(self, obj):
     return OrderModel.get_transition_name(obj.transition_target)