示例#1
0
def manage_time_slot(pattern, json):
    if 'time_slots' in json:
        for json_time_slot in json['time_slots']:
            time_slot = models.TimeSlot(pattern.id)
            mapper.fill_from_json(time_slot, json_time_slot,
                                  mapper.time_slot_mapping)
            pattern.insert_time_slot(time_slot)
示例#2
0
文件: history.py 项目: azime/Chaos-1
def create_pattern_time_slots_from_json(json):
    time_slots = []
    for time_slot_json in json:
        time_slot = models.TimeSlot()
        mapper.fill_from_json(time_slot, time_slot_json,
                              mapper.time_slot_mapping)
        time_slots.append(time_slot)

    return time_slots