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 dataviewdb.model_data_list(request, model, QSList(model,data['data']), model_url=reverse(data_list, args=(fn,)))
def save_datalist(data): fn="_tmp_%s"%id(data) head=data['heads'] attrs=dict([(str(k), models.CharField(max_length=1024, verbose_name=head[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'])) return fn
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,)))
def save_datalist(data):#---临时保存报表计算后所得的数据 fn="_tmp_%s"%id(data) head=data['heads'] attrs=dict([(str(k), models.CharField(max_length=1024, verbose_name=head[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'])) return fn
def SaveTmp(self): file_name = "_tmp_%s" % id(self.result) attrs = dict([( str(k), models.CharField( max_length=1024, verbose_name=self.__fieldcaptions[self.__fieldnames.index(k)])) for k in self.__fieldnames]) admin_attrs = {"read_only": True, "cache": False, "log": False} save_tmp_file(file_name, (attrs, admin_attrs, self.CalculateItems)) return file_name
def SaveTmp(self): file_name="_tmp_%s"%id(self.result) attrs=dict([(str(k), models.CharField(max_length=1024, verbose_name=self.__fieldcaptions[self.__fieldnames.index(k)])) for k in self.__fieldnames]) admin_attrs={"read_only":True, "cache": False, "log":False} save_tmp_file(file_name, (attrs, admin_attrs, self.CalculateItems)) return file_name