Exemplo n.º 1
0
def create_model(json):
    name = json["name"]
    type_name = json["type"]
    datasource_id = json["datasource"]
    input_columns = json["input-columns"]
    type_id = with_session(compose(
        getattr("id"),
        query_type_by_name(type_name)
    ))
    new_model_id = with_session(create_row(ModelModel, {
        "name": name,
        "type_id": type_id,
        "datasource_id": datasource_id
    }))["id"]
    with_session(create_input_columns(input_columns, new_model_id))
    queue_model_creation_task(json)
    return get_model(new_model_id)
Exemplo n.º 2
0
 def get_table_class(attr):
     return getattr(attr, Base.classes)
Exemplo n.º 3
0
def row_ids(model_class, session):
    return list(map(getattr("id"), query_all(model_class, session)))
Exemplo n.º 4
0
Arquivo: mn.py Projeto: flintc/sandbox
 def invoker(x):
     result = self.decorator(r.getattr(name, self._fn(x)))(*args,
                                                           **kwargs)
     return self.resolve(result)