Example #1
0
 def get_data(self):
     params = dict(row_renderer=self.__row_renderer,
                   start_row=self.__start_row,
                   row_limit=self.__row_limit)
     if self.__skip_row_func is not None:
         params['skip_row_func'] = self.__skip_row_func
     reader = QuerysetsReader(self.__query_sets, self.__column_names,
                              **params)
     data = reader.to_array()
     return {self.__sheet_name: data}
 def test_one_table(self):
     mysession = Session()
     writer = SQLTableWriter(mysession,
                             [Pyexcel, self.data[0], None, None])
     writer.write_array(self.data[1:])
     writer.close()
     query_sets = mysession.query(Pyexcel).all()
     reader = QuerysetsReader(query_sets, self.data[0])
     results = reader.to_array()
     assert list(results) == self.results
     mysession.close()
Example #3
0
 def test_one_table(self):
     mysession = Session()
     writer = SQLTableWriter(mysession,
                             [Pyexcel, self.data[0], None, None])
     writer.write_array(self.data[1:])
     writer.close()
     query_sets = mysession.query(Pyexcel).all()
     reader = QuerysetsReader(query_sets, self.data[0])
     results = reader.to_array()
     assert list(results) == self.results
     mysession.close()
Example #4
0
 def test_one_table(self):
     mysession = Session()
     importer = SQLTableImporter(mysession)
     adapter = SQLTableImportAdapter(Pyexcel)
     adapter.column_names = self.data[0]
     writer = SQLTableWriter(importer, adapter)
     writer.write_array(self.data[1:])
     writer.close()
     query_sets = mysession.query(Pyexcel).all()
     reader = QuerysetsReader(query_sets, self.data[0])
     results = reader.to_array()
     assert list(results) == self.results
     mysession.close()
Example #5
0
 def test_one_table(self):
     mysession = Session()
     importer = SQLTableImporter(mysession)
     adapter = SQLTableImportAdapter(Pyexcel)
     adapter.column_names = self.data[0]
     writer = SQLTableWriter(importer, adapter)
     writer.write_array(self.data[1:])
     writer.close()
     query_sets = mysession.query(Pyexcel).all()
     reader = QuerysetsReader(query_sets, self.data[0])
     results = reader.to_array()
     assert list(results) == self.results
     mysession.close()