本文整理汇总了Python中models.users.User.timezone方法的典型用法代码示例。如果您正苦于以下问题:Python User.timezone方法的具体用法?Python User.timezone怎么用?Python User.timezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.users.User
的用法示例。
在下文中一共展示了User.timezone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models.users import User [as 别名]
# 或者: from models.users.User import timezone [as 别名]
def post(self):
twitter = Twitter.getInstance()
model = model_from_request(self.request, RegisterModel)
# validate data; on error, redisplay form with error messages
if not model.validate():
self.view(model)
return
# save new user
user = User()
user.username = model.twitter_name
user.twitter = model.twitter_name
user.email = ""
pwd_hash = hashlib.md5()
pwd_hash.update(model.password)
user.password = pwd_hash.hexdigest()
user.timezone = ""
user.next_run_time = 0
user.message_type = "reply"
user.account_status = "enabled"
user.repeat_times = 6
user.followed_by = ""
user.i_follow = ""
user.messages_per_day = 10
user.default_source_lang = "en"
user.follow_lang_list = "en"
user.total_points = 0
user.put()
try:
twitter.api.CreateFriendship(model.twitter_name)
except:
pass
# put him into session
set_current_user(user)
# redirect to the home page
self.redirect("/profile")