Example #1
0
def response_datalist(request, data):
    fn="_tmp_%s"%id(data)
    attrs=dict([(k, models.CharField(max_length=1024, verbose_name=k)) for k in data['fields']])
    admin_attrs={"read_only":True, "cache": False, "log":False}
    utils.save_tmp_file(fn, (attrs, admin_attrs,  data['data']))
    model=create_model(fn, base_model=models.Model, attrs=attrs, admin_attrs=admin_attrs)  
    return data_viewdb.model_data_list(request, model, QSList(model,data['data']), model_url=reverse(data_list, args=(fn,)))
Example #2
0
def data_list_(request, fn):
    attrs, admin_attrs, data = utils.load_tmp_file(fn)
    model = create_model(fn.encode("utf-8"),
                         base_model=models.Model,
                         attrs=attrs,
                         admin_attrs=admin_attrs)
    return data_viewdb.model_data_list(request,
                                       model,
                                       QSList(model, data),
                                       model_url=reverse(data_list_,
                                                         args=(fn, )))
Example #3
0
def response_datalist(request, data):
    fn = "_tmp_%s" % id(data)
    attrs = dict([(k, models.CharField(max_length=1024, verbose_name=k))
                  for k in data['fields']])
    admin_attrs = {"read_only": True, "cache": False, "log": False}
    utils.save_tmp_file(fn, (attrs, admin_attrs, data['data']))
    model = create_model(fn,
                         base_model=models.Model,
                         attrs=attrs,
                         admin_attrs=admin_attrs)
    return data_viewdb.model_data_list(request,
                                       model,
                                       QSList(model, data['data']),
                                       model_url=reverse(data_list,
                                                         args=(fn, )))
Example #4
0
def data_list_(request, fn):
    attrs, admin_attrs, data=utils.load_tmp_file(fn)
    model=create_model(fn.encode("utf-8"), base_model=models.Model, attrs=attrs, admin_attrs=admin_attrs)
    return data_viewdb.model_data_list(request, model, QSList(model,data), model_url=reverse(data_list_, args=(fn,)))