本文整理汇总了Python中MaKaC.common.indexes.IndexesHolder.getBookings方法的典型用法代码示例。如果您正苦于以下问题:Python IndexesHolder.getBookings方法的具体用法?Python IndexesHolder.getBookings怎么用?Python IndexesHolder.getBookings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.common.indexes.IndexesHolder
的用法示例。
在下文中一共展示了IndexesHolder.getBookings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: iter_bookings
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import getBookings [as 别名]
def iter_bookings(self, idList, categ_id=None):
for vsid in idList:
if vsid in ["webcast", "recording"]:
idx = Catalog.getIdx("cs_booking_instance")[self.ID_TO_IDX[vsid]]
for __, bkw in idx.iter_bookings(self._fromDT, self._toDT):
yield bkw
else:
idx = IndexesHolder().getById("collaboration")
dateFormat = "%d/%m/%Y"
tempBookings = idx.getBookings(
self.ID_TO_IDX[vsid],
"conferenceStartDate",
self._orderBy,
self._fromDT,
self._toDT,
"UTC",
False,
None,
categ_id,
False,
dateFormat,
).getResults()
for evt, bks in tempBookings:
for bk in bks:
bk._conf = evt # Ensure all CSBookings are aware of their Conference
yield bk
示例2: video
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import getBookings [as 别名]
def video(self, idList, alarm = None):
idx = IndexesHolder().getById('collaboration');
bookings = []
dateFormat = '%d/%m/%Y'
self._alarm = alarm
for vsid in idList:
tempBookings = idx.getBookings(self.ID_TO_IDX[vsid], "conferenceStartDate",
self._orderBy, self._fromDT, self._toDT,
'UTC', False, None, None, False, dateFormat)
bookings.extend(tempBookings.getResults())
def _iter_bookings(objs):
for obj in objs:
for bk in obj[1]:
bk._conf = obj[0] # Ensure all CSBookings are aware of their Conference
""" This is for plugins whose structure include 'talkSelected',
examples of which in CERN Indico being WebcastRequest and
RecordingRequest.
"""
if bk.hasTalkSelection():
ts = bk.getTalkSelectionList()
contributions = []
if ts is None: # No individual talks, therefore an event for every contribution
contributions = bk._conf.getContributionList()
else:
for contribId in ts:
tempContrib = bk._conf.getContributionById(contribId)
contributions.append(tempContrib)
if len(contributions) == 0 or self._detail == "event": # If we are here, no contributions but a request exists.
bk.setStartDate(bk._conf.getStartDate())
bk.setEndDate(bk._conf.getEndDate())
yield bk
else: # Contributions is the list of all to be exported now
contributions = filter(lambda c: c.isScheduled(), contributions)
for contrib in contributions:
# Wrap the CSBooking object for export
bkw = CSBookingContributionWrapper(bk, contrib)
bkw.setStartDate(contrib.getStartDate())
bkw.setEndDate(contrib.getEndDate())
yield bkw
else:
yield bk
""" Simple filter, as this method can return None for Pending and True
for accepted, both are valid booking statuses for exporting.
"""
def _filter(obj):
return obj.getAcceptRejectStatus() is not False
iface = self.DETAIL_INTERFACES.get('all')
for booking in self._process(_iter_bookings(bookings), _filter, iface):
yield booking
示例3: initialize
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import getBookings [as 别名]
def initialize(self, dbi=None):
# empty tree
self.clear()
idx = IndexesHolder().getById('collaboration')
for conf, bks in idx.getBookings(self.index_name, 'conferenceStartDate', None, None, None).getResults():
for bk in bks:
self.index_booking(bk)
示例4: _getAnswer
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import getBookings [as 别名]
def _getAnswer(self):
ci = IndexesHolder().getById('collaboration')
return ci.getBookings(self._indexName,
self._viewBy,
self._orderBy,
self._minKey,
self._maxKey,
tz = self._tz,
onlyPending = self._onlyPending,
conferenceId = self._conferenceId,
categoryId = self._categoryId,
pickle = True,
dateFormat='%a %d %b %Y',
page = self._page,
resultsPerPage = self._resultsPerPage,
grouped=True)
示例5: iter_bookings
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import getBookings [as 别名]
def iter_bookings(self, idList, categ_id=None):
for vsid in idList:
if vsid not in self.ID_TO_IDX:
continue
if vsid in ['webcast', 'recording']:
idx = Catalog.getIdx('cs_booking_instance')[self.ID_TO_IDX[vsid]]
for __, bkw in idx.iter_bookings(self._fromDT, self._toDT):
yield bkw
else:
idx = IndexesHolder().getById('collaboration');
dateFormat = '%d/%m/%Y'
tempBookings = idx.getBookings(self.ID_TO_IDX[vsid], "conferenceStartDate",
self._orderBy, self._fromDT, self._toDT,
'UTC', False, None, categ_id, False, dateFormat).getResults()
for evt, bks in tempBookings:
for bk in bks:
bk._conf = evt # Ensure all CSBookings are aware of their Conference
yield bk