Example #1
0
 def __init__(self, model, export_columns=None, **keywords):
     self.__model = model
     if export_columns:
         column_names = export_columns
     else:
         column_names = sorted([
             field.attname for field in self.__model._meta.concrete_fields
         ])
     QuerysetsReader.__init__(self, self.__model.objects.all(),
                              column_names, **keywords)
 def __init__(self, model, export_columns=None, **keywords):
     self.__model = model
     if export_columns:
         column_names = export_columns
     else:
         column_names = sorted(
             [field.attname
              for field in self.__model._meta.concrete_fields])
     QuerysetsReader.__init__(self, self.__model.objects.all(),
                              column_names,
                              **keywords)
Example #3
0
 def __init__(self, session, table, export_columns=None, **keywords):
     everything = session.query(table).all()
     column_names = None
     if export_columns:
         column_names = export_columns
     else:
         if len(everything) > 0:
             column_names = sorted([
                 column for column in everything[0].__dict__
                 if column != '_sa_instance_state'])
     QuerysetsReader.__init__(self, everything, column_names, **keywords)
Example #4
0
 def __init__(self, session, table, export_columns=None, **keywords):
     everything = session.query(table).all()
     column_names = None
     if export_columns:
         column_names = export_columns
     else:
         if len(everything) > 0:
             column_names = sorted([
                 column for column in everything[0].__dict__
                 if column != '_sa_instance_state'
             ])
     QuerysetsReader.__init__(self, everything, column_names, **keywords)