本文整理汇总了Python中models.event.Event.registration_window方法的典型用法代码示例。如果您正苦于以下问题:Python Event.registration_window方法的具体用法?Python Event.registration_window怎么用?Python Event.registration_window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.event.Event
的用法示例。
在下文中一共展示了Event.registration_window方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_event
# 需要导入模块: from models.event import Event [as 别名]
# 或者: from models.event.Event import registration_window [as 别名]
def create_event(self, capacity=20, event_date=datetime.now() + timedelta(days=5), registration_window=5):
event = Event(parent=ndb.Key('Group', 'AgileYorkshire'))
event.date = event_date
event.description = 'An event'
event.capacity = capacity
event.registration_window = registration_window
event.put()
return event
示例2: post
# 需要导入模块: from models.event import Event [as 别名]
# 或者: from models.event.Event import registration_window [as 别名]
def post(self):
event = Event(parent=self.get_group_key())
event.date = datetime.strptime(self.request.get('event_date'), "%d %b %Y")
event.title = self.request.get('event_title')
event.description = self.request.get('event_description')
event.capacity = int(self.request.get('event_capacity'))
event.registration_window = int(self.request.get('event_registration_window'))
event_image = self.request.get('event_image')
event.image = event_image
presentations = self.request.get_all('event_presentations')
event_key = event.put()
for p in presentations:
presentation_key = ndb.Key(urlsafe=p)
presentation = presentation_key.get()
presentation.event_key = event_key
presentation.put()
self.redirect('/events')