本文整理汇总了Python中models.Transaction.description方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.description方法的具体用法?Python Transaction.description怎么用?Python Transaction.description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Transaction
的用法示例。
在下文中一共展示了Transaction.description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Transaction [as 别名]
# 或者: from models.Transaction import description [as 别名]
def post(self):
trans = Transaction(id=self.request.get("trans_code"))
trans.trans_code = self.request.get("trans_code")
sender = User.get_by_id(self.request.get("sender_code"))
trans.sender = sender.key.urlsafe()
receiver = User.get_by_id(self.request.get("receiver_code"))
trans.receiver = receiver.key.urlsafe()
trans.description = self.request.get("description")
logging.critical(self.request.get("eda"))
date = datetime.datetime.strptime(self.request.get("eda"), '%m/%d/%Y')
logging.critical(date)
trans.eda = date
p_code = ""
r_code = ""
while True:
p_code = parser_code()
parcel = P.get_by_id(p_code)
if not parcel:
break;
while True:
r_code = receiver_code()
receiver = R.get_by_id(r_code)
if not receiver:
break;
logging.critical(p_code)
logging.critical(r_code)
trans.parser_code = hash_code(p_code, "PARSER")
trans.receiver_code = hash_code(r_code, "RECEIVER")
trans.put()
""" save transaction for PARSEL code """
p = P(id=p_code)
p.codes = p_code
p.trans_key = trans.key.urlsafe()
p.put()
""" ---------------------------------- """
""" save transaction for RECEIVER code """
r = R(id=r_code)
r.codes = r_code
r.trans_key = trans.key.urlsafe()
r.put()
""" ---------------------------------- """
self.redirect(self.uri_for('www-login', success="Added!."))