def singleTransform(values, withUser=False):
    print('LIHAT INI', withUser)
    if withUser == True:
        data = {
            'id': values.id,
            'user_id': values.user_id,
            'nama_gor': values.nama_gor,
            'alamat_gor': values.alamat_gor,
            'created_at': values.created_at,
            'updated_at': values.updated_at,
            # 'user': UserController.singleTransform(values.users, withGor=False)
        }
    else:
        data = {
            'id': values.id,
            'user_id': values.user_id,
            'nama_gor': values.nama_gor,
            'alamat_gor': values.alamat_gor,
            'created_at': values.created_at,
            'updated_at': values.updated_at,
            'user': UserController.singleTransform(values.users, withGor=False)
        }
    print('singleTransform', data)

    return data
def singleTransform(event):
    data = {
        'id': event.id,
        'event': event.event,
        'description': event.description,
        'created_at': event.created_at,
        'updated_at': event.updated_at,
        'user': UserController.singleTransform(event.users)
    }
    return data
Exemplo n.º 3
0
def singleTransform(values):
    data = {
        'id': values.id,
        'user_id': values.user_id,
        'todo': values.todo,
        'description': values.description,
        'created_at': values.created_at,
        'updated_at': values.updated_at,
        'user': UserController.singleTransform(values.users, withTodo=False)
    }
    return data