本文整理汇总了Python中MaKaC.plugins.RoomBooking.default.factory.Factory.newReservation方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.newReservation方法的具体用法?Python Factory.newReservation怎么用?Python Factory.newReservation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.plugins.RoomBooking.default.factory.Factory
的用法示例。
在下文中一共展示了Factory.newReservation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getReservations2
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.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()
示例2: getReservations
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.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()
示例3: getAvailableRooms
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.factory.Factory import newReservation [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()
示例4: getNumberOfLiveReservations
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.factory import Factory [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.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)