当前位置: 首页>>代码示例>>Python>>正文


Python IndexesHolder.getBookings方法代码示例

本文整理汇总了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
开发者ID:arturodr,项目名称:indico,代码行数:30,代码来源:http_api.py

示例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
开发者ID:aninhalacerda,项目名称:indico,代码行数:61,代码来源:http_api.py

示例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)
开发者ID:VishrutMehta,项目名称:indico,代码行数:11,代码来源:components.py

示例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)
开发者ID:Ictp,项目名称:indico,代码行数:18,代码来源:services.py

示例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
开发者ID:pedrogaudencio,项目名称:indico,代码行数:23,代码来源:http_api.py


注:本文中的MaKaC.common.indexes.IndexesHolder.getBookings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。