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


Python ReservationBase.excludeDay方法代码示例

本文整理汇总了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
开发者ID:davidmorrison,项目名称:indico,代码行数:12,代码来源:reservation.py

示例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)
开发者ID:iason-andr,项目名称:indico,代码行数:22,代码来源:reservation.py

示例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)
                    )
开发者ID:arescope,项目名称:indico,代码行数:41,代码来源:reservation.py


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