コード例 #1
0
    def getRoomsByExample():
        Test.dalManager.connect()

        # By ID
        room = RoomBase.getRooms( roomID = 176 )
        assert( room.name == '4-1-021' )

        # By other attributes
        roomEx = Factory.newRoom()
        roomEx.site = 'prevessin'
        roomEx.comments = 'res'
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 8 ) # 20

        roomEx = Factory.newRoom()
        roomEx.capacity = 20
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 26 )

        roomEx = Factory.newRoom()
        roomEx.isReservable = True
        roomEx.setEquipment( [ 'Video projector', 'Wireless' ] )
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 33 )

        Test.dalManager.disconnect()
コード例 #2
0
ファイル: room.py プロジェクト: aninhalacerda/indico
    def getRoomsByExample():
        Test.dalManager.connect()

        # By ID
        room = RoomBase.getRooms( roomID = 176 )
        assert( room.name == '4-1-021' )

        # By other attributes
        roomEx = Factory.newRoom()
        roomEx.site = 'prevessin'
        roomEx.comments = 'res'
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 8 ) # 20

        roomEx = Factory.newRoom()
        roomEx.capacity = 20
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 26 )

        roomEx = Factory.newRoom()
        roomEx.isReservable = True
        roomEx.setEquipment( [ 'Video projector', 'Wireless' ] )
        rooms = RoomBase.getRooms( roomExample = roomEx )
        assert( len( rooms ) == 33 )

        Test.dalManager.disconnect()
コード例 #3
0
ファイル: room.py プロジェクト: jt1/indico
    def getRoomsByExample():
        Test.dalManager.connect()

        # By ID
        room = RoomBase.getRooms(roomID=176)
        assert room.name == "4-1-021"

        # By other attributes
        roomEx = Factory.newRoom()
        roomEx.site = "prevessin"
        roomEx.comments = "res"
        rooms = RoomBase.getRooms(roomExample=roomEx)
        assert len(rooms) == 8  # 20

        roomEx = Factory.newRoom()
        roomEx.capacity = 20
        rooms = RoomBase.getRooms(roomExample=roomEx)
        assert len(rooms) == 26

        roomEx = Factory.newRoom()
        roomEx.isReservable = True
        roomEx.setEquipment(["Video projector", "Wireless"])
        rooms = RoomBase.getRooms(roomExample=roomEx)
        assert len(rooms) == 33

        Test.dalManager.disconnect()
コード例 #4
0
ファイル: room.py プロジェクト: aninhalacerda/indico
 def getNumberOfReservableRooms( *args, **kwargs ):
     """ Documentation in base class. """
     location = kwargs.get( 'location', Location.getDefaultLocation().friendlyName )
     room = Factory.newRoom()
     room.isReservable = True
     room.isActive = True
     return Room.countRooms( roomExample = room, location = location )
コード例 #5
0
 def getNumberOfReservableRooms( *args, **kwargs ):
     """ Documentation in base class. """
     location = kwargs.get( 'location', Location.getDefaultLocation().friendlyName )
     room = Factory.newRoom()
     room.isReservable = True
     room.isActive = True
     return Room.countRooms( roomExample = room, location = location )
コード例 #6
0
ファイル: room.py プロジェクト: aninhalacerda/indico
    def getRoomsByExampleDemo():
        Test.dalManager.connect()

        roomEx = Factory.newRoom()

        roomEx.building = 513
        roomEx.capacity = 20

        rooms = CrossLocationQueries.getRooms( roomExample = roomEx )

        for room in rooms:
            print "============================="
            print room

        Test.dalManager.disconnect()
コード例 #7
0
    def getRoomsByExampleDemo():
        Test.dalManager.connect()

        roomEx = Factory.newRoom()

        roomEx.building = 513
        roomEx.capacity = 20

        rooms = CrossLocationQueries.getRooms( roomExample = roomEx )

        for room in rooms:
            print "============================="
            print room

        Test.dalManager.disconnect()
コード例 #8
0
ファイル: reservation.py プロジェクト: arescope/indico
    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()
コード例 #9
0
ファイル: room.py プロジェクト: jt1/indico
    def getAvailableRooms():
        Test.dalManager.connect()

        from datetime import datetime

        roomEx = Factory.newRoom()
        roomEx.isActive = True
        roomEx.isReservable = True

        resvEx = Factory.newReservation()
        resvEx.startDT = datetime(2006, 12, 01, 10)
        resvEx.endDT = datetime(2006, 12, 14, 15)
        resvEx.repeatability = 0  # Daily

        rooms = RoomBase.getRooms(roomExample=roomEx, resvExample=resvEx, available=True)

        for room in rooms:
            print "\n=======================================\n"
            print room

        Test.dalManager.disconnect()
コード例 #10
0
    def getAvailableRooms():
        Test.dalManager.connect()

        from datetime import datetime

        roomEx = Factory.newRoom()
        roomEx.isActive = True
        roomEx.isReservable = True

        resvEx = Factory.newReservation()
        resvEx.startDT = datetime( 2006, 12, 01, 10 )
        resvEx.endDT = datetime( 2006, 12, 14, 15 )
        resvEx.repeatability = 0 # Daily

        rooms = RoomBase.getRooms( \
            roomExample = roomEx,
            resvExample = resvEx,
            available = True )

        for room in rooms:
            print "\n=======================================\n"
            print room

        Test.dalManager.disconnect()