本文整理匯總了Python中models.Transaction.sender方法的典型用法代碼示例。如果您正苦於以下問題:Python Transaction.sender方法的具體用法?Python Transaction.sender怎麽用?Python Transaction.sender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Transaction
的用法示例。
在下文中一共展示了Transaction.sender方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: post
# 需要導入模塊: from models import Transaction [as 別名]
# 或者: from models.Transaction import sender [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!."))