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()
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()
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()
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()
def transition_name(self, obj): return OrderModel.get_transition_name(obj.transition_target)