def test03(self): "logical primary key versus atomic primary key" db=ledger_demo.startup() INVOICES = db.query(Invoice) INVOICELINES = db.query(ProductInvoiceLine) self.assertEqual(INVOICES.getLeadTable().getPrimaryKey(), ("jnl","seq")) self.assertEqual( tuple(map(lambda (n,t) : n, INVOICES.getLeadTable().getPrimaryAtoms())), ("jnl_id","seq") ) self.assertEqual(INVOICELINES.getLeadTable().getPrimaryKey(), ("invoice","line")) self.assertEqual( tuple(map(lambda (n,t) : n, INVOICELINES.getLeadTable().getPrimaryAtoms())), ("invoice_jnl_id","invoice_seq","line") ) db.shutdown()
from lino.apps.ledger.ledger_demo import startup from lino.apps.ledger.ledger_tables import Currency sess=startup(langs="en fr") qry=sess.query(Currency,"id name") # show in default language: qry.show() print # switch to FR and show again: sess.setBabelLangs("fr") qry.show() sess.shutdown()
def setUp(self): TestCase.setUp(self) self.sess = startup()
def setUp(self): TestCase.setUp(self) self.db = startup() self.db.setBabelLangs('en')
return self.dbsess.db.schema.getTableList() def setupReport(self): self.addVurtColumn( label="TableName", meth=lambda row: row.item.getTableName(), width=20) self.addVurtColumn( label="Count", meth=lambda row: len(row.qry), datatype=INT, width=5, halign=RIGHT ) self.addVurtColumn( label="First", meth=lambda row: unicode(row.qry[0]), when=lambda row: len(row.qry)>0, width=20) self.addVurtColumn( label="Last", meth=lambda row: unicode(row.qry[-1]), when=lambda row: len(row.qry)>0, width=20) sess = startup() rpt=DatabaseOverview(sess) rpt.show() sess.shutdown()
def setUp(self): TestCase.setUp(self) self.sess = startup() # dump=sys.stdout)
from lino.apps.ledger.ledger_demo import startup from lino.apps.ledger.ledger_forms import Ledger dbsess=startup() # filename="ledger.db") Ledger(dbsess).main()
def setUp(self): TestCase.setUp(self) self.db = startup()
from lino.apps.ledger.ledger_demo import startup from lino.apps.ledger.ledger_forms import Ledger dbsess = startup() # filename="ledger.db") Ledger(dbsess).main()