本文整理汇总了Python中models.Config.is_open方法的典型用法代码示例。如果您正苦于以下问题:Python Config.is_open方法的具体用法?Python Config.is_open怎么用?Python Config.is_open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Config
的用法示例。
在下文中一共展示了Config.is_open方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_open_or_close
# 需要导入模块: from models import Config [as 别名]
# 或者: from models.Config import is_open [as 别名]
def is_open_or_close():
c = Config.query().get()
if not c:
c = Config()
c.is_open = False
c.put()
return False
return c.is_open
示例2: sendMailResult
# 需要导入模块: from models import Config [as 别名]
# 或者: from models.Config import is_open [as 别名]
def sendMailResult():
# TODO: test this
message = mail.EmailMessage(sender="MercatoLibero <[email protected]>",
subject="Risultati")
users = User.query().fetch()
to = ""
for user in users:
to += user.email + ";"
message.to = to
calls_open = Call.query(Call.status == "OPEN").fetch()
status = Config.query().get()
if not status:
status = Config()
status.is_open = True
status.put()
if len(calls_open) > 0:
path = os.path.join(os.path.dirname(__file__), 'templates', 'mail_results.html')
params = dict(open=[e.to_dict() for e in calls_open])
res = template.render(path, params)
for o in calls_open:
o.status = "CLOSED"
o.put()
message.html = res
message.send()
示例3: get
# 需要导入模块: from models import Config [as 别名]
# 或者: from models.Config import is_open [as 别名]
def get(self):
status = Config.query().get()
if not status:
status = Config()
status.is_open = False
status.put()
示例4: set_open_or_closed
# 需要导入模块: from models import Config [as 别名]
# 或者: from models.Config import is_open [as 别名]
def set_open_or_closed(v):
c = Config.query().get()
if not c:
c = Config()
c.is_open = v
c.put()