本文整理汇总了Python中MaKaC.rb_reservation.ReservationBase.excludeDay方法的典型用法代码示例。如果您正苦于以下问题:Python ReservationBase.excludeDay方法的具体用法?Python ReservationBase.excludeDay怎么用?Python ReservationBase.excludeDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.rb_reservation.ReservationBase
的用法示例。
在下文中一共展示了ReservationBase.excludeDay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: excludeDay
# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import excludeDay [as 别名]
def excludeDay( self, dayD ):
"""
Inserts dayD into list of excluded days.
dayD should be of date type (NOT datetime).
"""
ReservationBase.excludeDay( self, dayD )
lst = self._excludedDays
if not dayD in lst:
lst.append( dayD )
self._excludedDays = lst # Force update
示例2: excludeDay
# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import excludeDay [as 别名]
def excludeDay( self, dayD, unindex = False ):
"""
Inserts dayD into list of excluded days.
dayD should be of date type (NOT datetime).
"""
ReservationBase.excludeDay( self, dayD )
lst = self._excludedDays
if not dayD in lst:
lst.append( dayD )
self._excludedDays = lst # Force update
if unindex:
dayReservationsIndexBTree = Reservation.getDayReservationsIndexRoot()
if dayReservationsIndexBTree.has_key(dayD):
try:
resvs = dayReservationsIndexBTree[dayD]
resvs.remove( self )
dayReservationsIndexBTree[dayD] = resvs
except ValueError, e:
Logger.get('RoomBooking').debug("excludeDay: Unindexing a day (%s) which is not indexed"%dayD)
示例3: excludeDay
# 需要导入模块: from MaKaC.rb_reservation import ReservationBase [as 别名]
# 或者: from MaKaC.rb_reservation.ReservationBase import excludeDay [as 别名]
def excludeDay(self, day, unindex=False):
"""
Inserts day into list of excluded days.
day should be of date type (NOT datetime).
"""
ReservationBase.excludeDay(self, day)
lst = self._excludedDays
if not day in lst:
lst.append(day)
self._excludedDays = lst # Force update
if unindex:
day_resv_idx = Reservation.getDayReservationsIndexRoot()
room_day_resv_idx = Reservation.getRoomDayReservationsIndexRoot()
if day in day_resv_idx:
try:
resvs = day_resv_idx[day]
resvs.remove(self)
day_resv_idx[day] = resvs
except ValueError, e:
Logger.get("RoomBooking").debug(
"excludeDay: DayReservationsIndex - unindexing " "a day ({0}) which is not indexed".format(day)
)
key = (self.room.id, day)
if key in room_day_resv_idx:
try:
resvs = room_day_resv_idx[key]
resvs.remove(self)
room_day_resv_idx[key] = resvs
except ValueError, e:
Logger.get("RoomBooking").debug(
"excludeDay: RoomDayReservationsIndex - unindexing "
"a key ({0}) which is not indexed".format(key)
)