def default_data(self): result = self.context.get_data(self.schema) result['artists'] = get_artist_data( result['artists'], self.schema.get('artists').children[0]) picture = get_file_data(result['picture']) result.update(picture) result[OBJECT_OID] = get_oid(self.context) return result
def default_data(self): result = self.context.get_data(CulturalEventSchema()) schedules = [] for schedule in result['schedules']: schedule_data = schedule.get_data(ScheduleSchema()) schedule_data[OBJECT_OID] = str(get_oid(schedule)) schedules.append(schedule_data) result['schedules'] = schedules result['artists'] = get_artist_data( result['artists'], self.schema.get('artists').children[0]) picture = get_file_data(result['picture']) result.update(picture) return result
def default_data(self): schedules = [] source = self.params('source') context = self.context if source: context = get_obj(int(source)) result = context.get_data(self.schema) for schedule in result['schedules']: schedule_data = schedule.get_data( self.schema.get('schedules').children[0]) schedules.append(schedule_data) result['artists'] = get_artist_data( result['artists'], self.schema.get('artists').children[0]) picture = get_file_data(result['picture'], True) result.update(picture) result['schedules'] = schedules return result