def is_past_stage(self, lookup_stage_id): res = False my_stage_id = self.stage_id for iter_stage_id in BILL_STAGES.keys(): if lookup_stage_id == iter_stage_id: res = True if my_stage_id == iter_stage_id: break return res
def stage_id(self): try: return (key for key, value in BILL_STAGES.items() if value == self.stage).next() except StopIteration: return BILL_STAGES['UNKNOWN']