def add(self, calendar, show=True, color1=None, color2=None): if not color1 or not color2: used_colors = [(item.color1, item.color2) for item in self] color1, color2 = choose_color(DEFAULT_COLORS, used_colors) info = CalendarOverlayInfo(calendar, show, color1, color2) info.__parent__ = self.this BoundRelationshipProperty.add(self, calendar, info) return info
def __init__(self, this, rel_type, my_role, other_role, filter_meanings=(ACTIVE,), filter_date=_today, filter_codes=()): BoundRelationshipProperty.__init__( self, this, rel_type, my_role, other_role) if filter_date is _today: self.filter_date = self.today else: self.filter_date = filter_date self.filter_codes = set(filter_codes) self.filter_meanings = filter_meanings self.init_filter()
def __init__(self, this, rel_type, my_role, other_role, filter_meanings=(ACTIVE, ), filter_date=_today, filter_codes=()): BoundRelationshipProperty.__init__(self, this, rel_type, my_role, other_role) if filter_date is _today: self.filter_date = self.today else: self.filter_date = filter_date self.filter_codes = set(filter_codes) self.filter_meanings = filter_meanings self.init_filter()
def __init__(self, this): BoundRelationshipProperty.__init__(self, this, URICalendarSubscription, URICalendarSubscriber, URICalendarProvider) # for the local grants to work self.__parent__ = this
def bind(self, instance, my_role, rel_type, other_role): return BoundRelationshipProperty( instance, rel_type, my_role, other_role)