def validate_order_type(self, value): try: self.order_type.data = PayTypeEnum.from_name(value.data) except Exception as e: raise StopValidation("无效的 order_id")
def validate_payment_way(self, value): try: self.payment_way.data = PayTypeEnum.from_name(value.data) except Exception as e: raise StopValidation("无效的 payment_way")