本文整理汇总了Python中model.user.User.name方法的典型用法代码示例。如果您正苦于以下问题:Python User.name方法的具体用法?Python User.name怎么用?Python User.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.user.User
的用法示例。
在下文中一共展示了User.name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import name [as 别名]
def get(self):
user = User()
user.email = ""
user.password = ""
user.name=""
user.password_confirm = ""
return self.render('setting_add_user.html', user_name="", user=user, errors={})
示例2: get_events
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import name [as 别名]
def get_events(self, params):
"""
Gets events from calendar
"""
calendar_service = gdata.calendar.service.CalendarService()
# Tell the service that we are running in single user mode, and it should not
# automatically try to associate the token with the current user then store
# it in the datastore.
gdata.alt.appengine.run_on_appengine(calendar_service, store_tokens=False, single_user_mode=True)
calendar_service.SetClientLoginToken(db.get(db.Key(params.key)).token)
# Parse Atom entries into CalendarEvent value objects
events = ArrayCollection()
feed = calendar_service.GetCalendarEventFeed()
for i, an_event in enumerate(feed.entry):
event = CalendarEvent()
event.title = an_event.title.text
# Convert start/end ISO time values to datetime using a different
# format depending on whether the string contains time information
start = an_event.when[0].start_time
end = an_event.when[0].end_time
if len(start) > 10:
event.start = datetime.strptime(start[0:19], DATETIME_ISO_STRING_FORMAT)
event.end = datetime.strptime(end[0:19], DATETIME_ISO_STRING_FORMAT)
else:
event.start = datetime.strptime(start, DATE_ISO_STRING_FORMAT)
event.end = datetime.strptime(end, DATE_ISO_STRING_FORMAT)
event.location = an_event.where[0].value_string
event.description = an_event.content.text
event.updated = datetime.strptime(an_event.updated.text[0:19], DATETIME_ISO_STRING_FORMAT)
# Create array collection of participants as User value objects
participants = ArrayCollection()
for p, a_participant in enumerate(an_event.who):
participant = User()
participant.name = a_participant.name
participant.email = a_participant.email
if a_participant.attendee_status:
participant.attendeeStatus = a_participant.attendee_status.value
participants.addItem(participant)
event.participants = participants
events.addItem(event)
return events
示例3: join_game
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import name [as 别名]
def join_game(self, game, name):
sess = User(uid = uuid.uuid4().hex)
sess.secret = channel.create_channel(sess.uid)
sess.gid = game.gid;
sess.name = name
sess.put()
self.response.set_cookie('Session', sess.uid)
# We don't need to save this as create() has more stuff to add
game.members.append(sess.name)
self.user = sess
# The userid
return sess.uid
示例4: post
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import name [as 别名]
def post(self):
email = self.get_argument('email','')
user_name = self.get_argument('user_name','')
password = self.get_argument('password','')
password_confirm = self.get_argument('password_confirm','')
user = User()
user.email = email
user.name = user_name
user.password = password
user.password_confirm = password_confirm
user_id = user.create()
if not user_id:
return self.render('register.html', user_name="", user=user, errors=user.errors)
#return self.send_error_json(user.errors)
else:
self.redirect('/login')