def query(self): return AccountingOperationUpload.query().options( load_only( AccountingOperationUpload.id, AccountingOperationUpload.created_at, AccountingOperationUpload.date, AccountingOperationUpload.filename, ))
def migrate_datas(): from autonomie_base.models.base import DBSESSION session = DBSESSION() from autonomie.models.accounting.operations import AccountingOperationUpload for entry in AccountingOperationUpload.query(): entry.filetype = "analytical_balance" session.merge(entry) session.flush()
def query(self): return AccountingOperationUpload.query().options( load_only( AccountingOperationUpload.id, AccountingOperationUpload.created_at, AccountingOperationUpload.date, AccountingOperationUpload.filename, AccountingOperationUpload.filetype, ) )
def analytical_upload(dbsession): from autonomie.models.accounting.operations import ( AccountingOperationUpload ) item = AccountingOperationUpload( md5sum="oooo", filetype="analytical_balance", date=datetime.date.today(), ) dbsession.add(item) return item