def set_allowed_content(self, folder: Content, allowed_content_dict: dict): """ :param folder: the given folder instance :param allowed_content_dict: must be something like this: dict( folder = True thread = True, file = False, page = True ) :return: """ properties = dict(allowed_content=allowed_content_dict) folder.properties = properties
def set_allowed_content(self, folder: Content, allowed_content_dict:dict): """ :param folder: the given folder instance :param allowed_content_dict: must be something like this: dict( folder = True thread = True, file = False, page = True ) :return: """ properties = dict(allowed_content = allowed_content_dict) folder.properties = properties
def populate_content_with_event( self, content: Content, event: iCalendarEvent, event_name: str, ) -> None: """ Populate Content content instance from iCalendarEvent event attributes. :param content: content to populate :param event: event with data to insert in content :param event_name: Event name (ID) like 20160602T083511Z-18100-1001-1-71_Bastien-20160602T083516Z.ics :return: given content """ content.label = event.get('summary') content.description = event.get('description') content.properties = { 'name': event_name, 'location': event.get('location'), 'raw': event.to_ical().decode("utf-8"), 'start': event.get('dtend').dt.strftime('%Y-%m-%d %H:%M:%S%z'), 'end': event.get('dtstart').dt.strftime('%Y-%m-%d %H:%M:%S%z'), }