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


Python ReservationBase.getReservations方法代码示例

本文整理汇总了Python中MaKaC.rb_reservation.ReservationBase.getReservations方法的典型用法代码示例。如果您正苦于以下问题:Python ReservationBase.getReservations方法的具体用法?Python ReservationBase.getReservations怎么用?Python ReservationBase.getReservations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaKaC.rb_reservation.ReservationBase的用法示例。


在下文中一共展示了ReservationBase.getReservations方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getReservations2

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
    def getReservations2():
        from MaKaC.rb_room import RoomBase
        
        Test.dalManager.connect()
        
        resvEx = Factory.newReservation()
        resvEx.startDT = datetime( 2006, 12, 01, 10 )
        resvEx.endDT = datetime( 2006, 12, 14, 15 )
        resvEx.repeatability = 0 # Daily
        
        #ReservationBase.getReservations( \
        #    roomExample = roomEx, 
        #    resvExample = resvEx,
        #    available = True )

        resv = ReservationBase.getReservations( resvID = 363818 )
        print resv
        r = Reservation()
        r.room = resv.room
        r.startDT = datetime( 2006, 10, 13, 8, 30 )
        r.endDT = datetime( 2006, 10, 13, 17, 30 )
        col = r.getCollisions()
        print col

        Test.dalManager.disconnect()
开发者ID:davidmorrison,项目名称:indico,代码行数:27,代码来源:reservation.py

示例2: _process

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
    def _process( self ):
        from MaKaC.rb_room import RoomBase
        from datetime import datetime,timedelta
        from MaKaC.rb_reservation import ReservationBase

        startdt = enddt = datetime.now()
        today = startdt.date()
        startdt.replace( hour = 0, minute = 0)
        enddt.replace( hour = 23, minute = 59)

        self._responseUtil.content_type = 'text/xml'
        XG = xmlGen.XMLGen()
        XG.openTag("response")

        rooms = RoomBase.getRooms()
        nbRooms = len(rooms)
        nbPublicRooms = nbPrivateRooms = nbSemiPrivateRooms = 0
        for r in rooms:
            if not r.isReservable:
                nbPrivateRooms += 1
            elif not r.resvsNeedConfirmation:
                nbPublicRooms += 1
            else:
                nbSemiPrivateRooms += 1

        self._createIndicator(XG, "total", "total number of managed rooms", nbRooms)
        self._createIndicator(XG, "public", "number of public rooms", nbPublicRooms)
        self._createIndicator(XG, "semiprivate", "number of semi-private rooms", nbSemiPrivateRooms)
        self._createIndicator(XG, "private", "number of private rooms", nbPrivateRooms)

        resvex = ReservationBase()
        resvex.isConfirmed = True
        resvex.isCancelled = False
        nbResvs = len(ReservationBase.getReservations( resvExample = resvex, days = [ startdt.date() ] ))
        resvex.usesAVC = True
        nbAVResvs = len(ReservationBase.getReservations( resvExample = resvex, days = [ startdt.date() ] ))
        resvex.needsAVCSupport = True
        resvex.needsAssistance = False
        nbAVResvsWithSupport = len(ReservationBase.getReservations( resvExample = resvex, days = [ startdt.date() ] ))

        self._createIndicator(XG, "nbbookings", "total number of bookings for today", nbResvs)
        self._createIndicator(XG, "nbvc", "number of remote collaboration bookings (video or phone conference)", nbAVResvs)
        self._createIndicator(XG, "nbvcsupport", "number of remote collaboration bookings with planned IT support", nbAVResvsWithSupport)

        XG.closeTag("response")
        return XG.getXml()
开发者ID:Ictp,项目名称:indico,代码行数:48,代码来源:xmlGateway.py

示例3: getReservations

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
    def getReservations( self, resvExample = None, archival = None ):
        """
        FINAL (not intented to be overriden)
        Returns reservations of this room, meeting specified criteria.
        Look ReservationBase.getReservations for details.
        """
        # Simply redirect to the plugin
        from MaKaC.rb_reservation import ReservationBase

        return ReservationBase.getReservations( resvExample = resvExample, rooms = [self], archival = archival )
开发者ID:iason-andr,项目名称:indico,代码行数:12,代码来源:rb_room.py

示例4: sendStartNotifications

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
def sendStartNotifications(logger):
    if getRoomBookingOption('notificationHour') != datetime.now().hour:
        if DEBUG:
            print 'Outside notification hour. Continuing anyway due to debug mode.'
        else:
            return
    days = _getRoomSpecificNotificationBeforeDays()
    days.add(getRoomBookingOption('notificationBefore'))
    dates = [date.today() + timedelta(days=day) for day in days]
    if DEBUG:
        print 'Dates to check: %r' % map(str, dates)
    for resv in ReservationBase.getReservations(days=dates): # for testing, remove location later
        se = resv.getStartEndNotification()
        se.sendStartNotification(logger)
开发者ID:Ictp,项目名称:indico,代码行数:16,代码来源:notifications.py

示例5: getLiveReservations

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
    def getLiveReservations(self, resvExample=None):
        """
        FINAL (not intented to be overriden)
        Returns valid, non archival reservations of this room,
        meeting specified criteria. Look ReservationBase.getReservations for details.
        """
        from MaKaC.rb_factory import Factory
        from MaKaC.rb_reservation import ReservationBase

        if resvExample is None:
            resvExample = Factory.newReservation()
        resvExample.isCancelled = False
        resvExample.isRejected = False

        return ReservationBase.getReservations(resvExample=resvExample, rooms=[self], archival=False)
开发者ID:arescope,项目名称:indico,代码行数:17,代码来源:rb_room.py

示例6: getReservations

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
    def getReservations():
        from MaKaC.rb_room import RoomBase
        
        Test.dalManager.connect()

        roomEx = Factory.newRoom()
        roomEx.name = 'TH AMPHITHEATRE'
        
        resvEx = Factory.newReservation()
        resvEx.startDT = datetime( 2006, 12, 01, 10 )
        resvEx.endDT = datetime( 2006, 12, 14, 15 )
        #resvEx.bookedForName = 'Jean-Jacques Blais'
        resvs = ReservationBase.getReservations( resvExample = resvEx, rooms = [roomEx] )

        for resv in resvs:
            print "============================="
            print resv
        
        Test.dalManager.disconnect()
开发者ID:davidmorrison,项目名称:indico,代码行数:21,代码来源:reservation.py

示例7: countReservations

# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import getReservations [as 别名]
 def countReservations( *args, **kwargs ):
     """ Documentation in base class. """
     kwargs['countOnly'] = True
     return ReservationBase.getReservations( **kwargs )
开发者ID:davidmorrison,项目名称:indico,代码行数:6,代码来源:reservation.py


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