예제 #1
0
    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()
예제 #2
0
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()

예제 #3
0
 def setUp(self):
     TestCase.setUp(self)
     self.sess = startup()
예제 #4
0
 def setUp(self):
     TestCase.setUp(self)
     self.db = startup()
     self.db.setBabelLangs('en')
예제 #5
0
        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()
예제 #6
0
 def setUp(self):
     TestCase.setUp(self)
     self.sess = startup() # dump=sys.stdout)
예제 #7
0
from lino.apps.ledger.ledger_demo import startup
from lino.apps.ledger.ledger_forms import Ledger

dbsess=startup() # filename="ledger.db")
Ledger(dbsess).main()


예제 #8
0
 def setUp(self):
     TestCase.setUp(self)
     self.db = startup()
예제 #9
0
파일: 23.py 프로젝트: MaxTyutyunnikov/lino
 def setUp(self):
     TestCase.setUp(self)
     self.db = startup()
예제 #10
0
from lino.apps.ledger.ledger_demo import startup
from lino.apps.ledger.ledger_forms import Ledger

dbsess = startup()  # filename="ledger.db")
Ledger(dbsess).main()