本文整理汇总了Python中models.Server.email方法的典型用法代码示例。如果您正苦于以下问题:Python Server.email方法的具体用法?Python Server.email怎么用?Python Server.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Server
的用法示例。
在下文中一共展示了Server.email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Server [as 别名]
# 或者: from models.Server import email [as 别名]
def post(self):
server = Server(key_name=self.request.get('serverdomain'))
server.serverdomain = self.request.get('serverdomain')
if self.request.get('ssl') == "True":
server.ssl = True
else:
server.ssl = False
if self.request.get('notifywithprowl') == "True":
server.notifywithprowl = True
if self.request.get('notifywithemail') == "True":
server.notifywithemail = True
#server.notifywithprowl = self.request.get('notifywithtwitter')
server.email = users.get_current_user().email()
server.put()
self.redirect('/admin')
示例2: getServer
# 需要导入模块: from models import Server [as 别名]
# 或者: from models.Server import email [as 别名]
def getServer(self):
serverdomain = self.request.get('serverdomain')
server_ssl = False
url = "http"
if self.request.get('ssl') == "True":
server_ssl = True
url += "s"
url += "://%s" % serverdomain
notifywithprowl = self.request.get('notifywithprowl')
notifywithemail = self.request.get('notifywithemail')
parser = self.request.get('parser')
parsermetadata = self.request.get('parsermetadata')
# Figure out the key.
keyvalue = "%s_%s_%s" % (url, parser, parsermetadata)
if notifywithprowl:
keyvalue += "_Y"
else:
keyvalue += "_N"
if notifywithemail:
keyvalue += "_Y"
else:
keyvalue += "_N"
server = Server(key_name=keyvalue)
server.url = url
server.serverdomain = serverdomain
server.ssl = server_ssl
if notifywithprowl == "True":
server.notifywithprowl = True
if notifywithemail == "True":
server.notifywithemail = True
#server.notifywithtwitter = self.request.get('notifywithtwitter')
server.parser = parser
server.parsermetadata = parsermetadata
server.email = users.get_current_user().email()
return server