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


Python Factory.newReservation方法代码示例

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


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

示例1: getReservations2

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [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: getReservations

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [as 别名]
    def getReservations():
        from MaKaC.rb_factory import Factory

        dalManager = Factory.getDALManager()
        dalManager.connect()

        amphitheatre = RoomBase.getRooms( roomName = 'IT AMPHITHEATRE' )
        print "All reservations for IT AMPHITHEATRE: %d" % len( amphitheatre.getReservations() )

        resvEx = Factory.newReservation()
        resvEx.startDT = datetime( 2006, 9, 23, 0 )
        resvEx.endDT = datetime( 2006, 9, 30, 23, 59 )

        dalManager.disconnect()
开发者ID:iason-andr,项目名称:indico,代码行数:16,代码来源:rb_room.py

示例3: getLiveReservations

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [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

示例4: getReservations

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [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

示例5: getNumberOfLiveReservations

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [as 别名]
 def getNumberOfLiveReservations( *args, **kwargs ):
     """ Documentation in base class. """
     location = kwargs.get( 'location', Location.getDefaultLocation().friendlyName )
     resvEx = Factory.newReservation()
     resvEx.isValid = True
     return Reservation.countReservations( resvExample = resvEx, archival = False, location = location )
开发者ID:davidmorrison,项目名称:indico,代码行数:8,代码来源:reservation.py

示例6: specified

# 需要导入模块: from MaKaC.rb_factory import Factory [as 别名]
# 或者: from MaKaC.rb_factory.Factory import newReservation [as 别名]
        return """At least one roomID must be specified (http://....?r=1,42,14,...)"""
    try:
        roomIDs = map(lambda x: int(x), roomIDs)
    except ValueError:
        return """Room IDs must be integers separated by commas (http://....?r=1,42,14,...)"""
    if len(roomIDs) > 10:
        return "One can only export 10 rooms at most"

    #################### process ###################
    rooms = []
    for roomID in roomIDs:
        roomEx = Factory.newRoom()
        roomEx.id = roomID
        rooms.append(roomEx)

    resvEx = Factory.newReservation()
    resvEx.isCancelled = False
    resvEx.isRejected = False
    resvEx.startDT = datetime(sd.year, sd.month, sd.day, 0, 0)
    resvEx.endDT = datetime(ed.year, ed.month, ed.day, 23, 59)
    resvs = CrossLocationQueries.getReservations(location="CERN", resvExample=resvEx, rooms=rooms)
    collisions = []
    for resv in resvs:
        for p in resv.splitToPeriods(endDT=resvEx.endDT, startDT=resvEx.startDT):
            collisions.append(Collision( ( p.startDT, p.endDT ), resv ))

    of = params.get("of", "csv")
    if of == "xml":
        result = createXML(collisions, req)
    else:
        result = createCSV(collisions, req)
开发者ID:arturodr,项目名称:indico,代码行数:33,代码来源:exportReservations.py


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