本文整理汇总了Python中zkpylons.model.location.Location.find_scheduled_by_date_and_type方法的典型用法代码示例。如果您正苦于以下问题:Python Location.find_scheduled_by_date_and_type方法的具体用法?Python Location.find_scheduled_by_date_and_type怎么用?Python Location.find_scheduled_by_date_and_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zkpylons.model.location.Location
的用法示例。
在下文中一共展示了Location.find_scheduled_by_date_and_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: table
# 需要导入模块: from zkpylons.model.location import Location [as 别名]
# 或者: from zkpylons.model.location.Location import find_scheduled_by_date_and_type [as 别名]
def table(self, day=None):
filter = dict(request.GET)
if len(c.scheduled_dates) == 0:
return render('/schedule/no_schedule_available.mako')
c.display_date = None
available_days = {}
for scheduled_date in c.scheduled_dates:
available_days[scheduled_date.strftime('%A').lower()] = scheduled_date
if day in available_days:
c.display_date = available_days[day]
if c.display_date is None:
if date.today() in c.scheduled_dates:
c.display_date = date.today()
else:
c.display_date = c.scheduled_dates[0]
c.time_slots = TimeSlot.find_by_date(c.display_date)
c.primary_times = {}
for time_slot in TimeSlot.find_by_date(c.display_date, primary=True):
c.primary_times[time_slot.start_time] = time_slot
event_type = EventType.find_by_name('presentation')
c.locations = Location.find_scheduled_by_date_and_type(c.display_date, event_type)
event_type = EventType.find_by_name('mini-conf')
c.locations = c.locations + Location.find_scheduled_by_date_and_type(c.display_date, event_type)
c.schedule_collection = Schedule.find_by_date(c.display_date)
c.time_increment = timedelta(minutes=5)
c.programme = OrderedDict()
for time_slot in c.time_slots:
time = time_slot.start_time
while time < time_slot.end_time:
c.programme[time] = {}
time = time + c.time_increment
for schedule in c.schedule_collection:
exclusive_event = schedule.time_slot.exclusive_event()
time = schedule.time_slot.start_time
if exclusive_event:
c.programme[time]['exclusive'] = exclusive_event
else:
c.programme[time][schedule.location] = schedule
if filter.has_key('raw'):
return render('/schedule/table_raw.mako')
else:
return render('/schedule/table.mako')