當前位置: 首頁>>代碼示例>>Python>>正文


Python Transaction.receiver_code方法代碼示例

本文整理匯總了Python中models.Transaction.receiver_code方法的典型用法代碼示例。如果您正苦於以下問題:Python Transaction.receiver_code方法的具體用法?Python Transaction.receiver_code怎麽用?Python Transaction.receiver_code使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models.Transaction的用法示例。


在下文中一共展示了Transaction.receiver_code方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: post

# 需要導入模塊: from models import Transaction [as 別名]
# 或者: from models.Transaction import receiver_code [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!."))
開發者ID:,項目名稱:,代碼行數:54,代碼來源:


注:本文中的models.Transaction.receiver_code方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。