本文整理汇总了Python中event.models.Event.location方法的典型用法代码示例。如果您正苦于以下问题:Python Event.location方法的具体用法?Python Event.location怎么用?Python Event.location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event.models.Event
的用法示例。
在下文中一共展示了Event.location方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_event_info
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import location [as 别名]
def save_event_info(request_data, event=None, date=None, event_group=None):
team = Team.objects.get(pk=request_data['team'])
if not event:
try:
event = Event.objects.get(pk=request_data['eventId'])
except:
event = Event()
event.title = request_data['title']
event.team = team
event.location = request_data['location']
event.info = request_data['info'] or ""
event.opponent = request_data['opponent'] or ""
if date:
date_string = date.strftime('%Y-%m-%d')
else:
date_string = request_data['date']
event.meetup_datetime = datetime.datetime.strptime(date_string + " " + request_data['meetupTime'], '%Y-%m-%d %H:%M')
event.start_datetime = datetime.datetime.strptime(date_string + " " + request_data['startTime'], '%Y-%m-%d %H:%M')
event.end_datetime = datetime.datetime.strptime(date_string + " " + request_data['endTime'], '%Y-%m-%d %H:%M')
event.reminder_time = request_data['reminderTime']
if request_data.get('lastSignupDate') and request_data.get('lastSignupTime'):
event.last_signup_datetime = datetime.datetime.strptime(request_data['lastSignupDate'] + " " + request_data['lastSignupTime'], '%Y-%m-%d %H:%M')
else:
event.last_signup_datetime = None
if event_group:
event.event_group = event_group
event_group.save()
event.save()
_update_event_players(request_data['attendees'], event, request_data['notInvited'], request_data['shareEvent'])
_update_event_coaches(event)
return event