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


Python Factory.newRoom方法代码示例

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


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

示例1: getRoomsByExample

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [as 别名]
    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()
开发者ID:aninhalacerda,项目名称:indico,代码行数:28,代码来源:room.py

示例2: getRoomsByExample

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [as 别名]
    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()
开发者ID:jt1,项目名称:indico,代码行数:28,代码来源:room.py

示例3: getNumberOfReservableRooms

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [as 别名]
 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 )
开发者ID:aninhalacerda,项目名称:indico,代码行数:9,代码来源:room.py

示例4: getRoomsByExampleDemo

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [as 别名]
    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()
开发者ID:aninhalacerda,项目名称:indico,代码行数:17,代码来源:room.py

示例5: getReservations

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [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:arescope,项目名称:indico,代码行数:21,代码来源:reservation.py

示例6: getAvailableRooms

# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newRoom [as 别名]
    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()
开发者ID:jt1,项目名称:indico,代码行数:23,代码来源:room.py


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