当前位置: 首页>>代码示例>>Python>>正文


Python Document.get_doc方法代码示例

本文整理汇总了Python中model.Document.get_doc方法的典型用法代码示例。如果您正苦于以下问题:Python Document.get_doc方法的具体用法?Python Document.get_doc怎么用?Python Document.get_doc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model.Document的用法示例。


在下文中一共展示了Document.get_doc方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: store_digest

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
  def store_digest(self, digest):
    docproof = Document.get_doc(digest)
    if docproof:
      return {"success" : False, "reason": "existing", "digest": digest, "args": [export_timestamp(docproof.timestamp)]}

    d = Document.new(digest)
    self.doc = d
    return {"success": True, "digest": d.digest}
开发者ID:dm04806,项目名称:proofofexistence,代码行数:10,代码来源:doc.py

示例2: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
 def handle(self):
     digest = self.request.get("d")
     doc = Document.get_doc(digest)
     if not doc or not doc.tx:
         return {"success" : False, "error": "format"}
     # TODO: add check to prevent double timestamping
     tx, message = publish_data_old(doc)
     do_check_document(digest)
     return {"success" : True, "tx" : tx, "message" : message}
开发者ID:martindale,项目名称:proof-of-existence,代码行数:11,代码来源:main.py

示例3: process_payment

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
    def process_payment(self, satoshis, digest):
        secret = self.request.get("secret")
        if len(digest) != 64 or secret != CALLBACK_SECRET or satoshis < MIN_SATOSHIS_PAYMENT:
            return {"success" : False, "reason" : "format or payment below " + str(MIN_SATOSHIS_PAYMENT)}

        doc = Document.get_doc(digest)
        if not doc:
            return {"success" : False, "reason" : "Couldn't find document"}
        doc.pending = False
        doc.put()

        return {"success" : True}
开发者ID:martindale,项目名称:proof-of-existence,代码行数:14,代码来源:main.py

示例4: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
  def handle(self):
    digest = self.request.get("d")
    doc = Document.get_doc(digest)
    if not digest:
      return {"success": False, "reason": "format"}
    if not doc:
      return {"success": False, "reason": "nonexistent"}
    if doc.tx:
      return {"success": True, "status": "confirmed", "transaction": doc.tx}
    if doc.is_actionable():
      return {"success": True, "status": "pending"}

    return {"success": True, "status": "registered"}
开发者ID:MrChrisJ,项目名称:proofofexistence,代码行数:15,代码来源:api.py

示例5: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
 def handle(self):
   digest = self.request.get("d")
   doc = Document.get_doc(digest)
   if not doc or doc.tx:
     return {"success" : False, "error": "format"}
   # TODO: add check to prevent double timestamping
   txid, message = publish_data(doc.digest.decode('hex'))
   if txid:
     doc.tx = txid
     doc.txstamp = datetime.datetime.now()
     LatestBlockchainDocuments.get_inst().add_document(digest)
     doc.put()
   return {"success" : txid is not None, "tx" : txid, "message" : message}
开发者ID:Nipperkin,项目名称:proofofexistence,代码行数:15,代码来源:admin.py

示例6: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
  def handle(self):
    digest = self.request.get("d")
    doc = Document.get_doc(digest)
    if not doc or not doc.payment_address:
      return {"success" : False, "error": "format"}
    
    txs = get_txs_for_addr(doc.payment_address)
    if not txs or len(txs) == 0:
      return {"success" : False, "error": "no transactions"}
    tx_hash, tx_timestamp = txs[0]
    doc.confirmed(tx_hash, tx_timestamp)

    LatestBlockchainDocuments.get_inst().add_document(doc)
    return {"success" : True, "tx" : doc.tx}
开发者ID:dm04806,项目名称:proofofexistence,代码行数:16,代码来源:doc.py

示例7: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
    def handle(self):
        digest = self.request.get("d")
        doc = Document.get_doc(digest)
        if not digest:
            return {"success": False, "reason": "format"}
        if not doc:
            return {"success": False, "reason": "nonexistent"}
        if doc.tx:
            return {"success": True, "status": "confirmed", "transaction": doc.tx, "txstamp": doc.txstamp}
        if doc.is_actionable():
            return {"success": True, "status": "pending"}

        return {
            "success": True,
            "status": "registered",
            "pay_address": doc.payment_address,
            "price": MIN_SATOSHIS_PAYMENT,
        }
开发者ID:geocontrol,项目名称:proofofexistence,代码行数:20,代码来源:api.py

示例8: handle

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
 def handle(self):
   digest = self.request.get("d")
   doc = Document.get_doc(digest)
   if not doc:
     return {"success" : False, "error": "format"}
   return doc.blockchain_certify()
开发者ID:MrChrisJ,项目名称:proofofexistence,代码行数:8,代码来源:admin.py

示例9: get

# 需要导入模块: from model import Document [as 别名]
# 或者: from model.Document import get_doc [as 别名]
 def get(self):
   digest = self.request.get('d')
   d = Document.get_doc(digest)
   if d and d.pending and d.has_balance():
     d.received_payment()
     self.response.write("%s %s<br />" % (d.digest, d.payment_address))
开发者ID:BitcoinSolution,项目名称:proofofexistence,代码行数:8,代码来源:cron.py


注:本文中的model.Document.get_doc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。