[SQL-CVS] r492 - home/phd/SQLObject/inheritance/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2004-12-16 14:23:51
|
Author: phd Date: 2004-12-16 14:23:48 +0000 (Thu, 16 Dec 2004) New Revision: 492 Modified: home/phd/SQLObject/inheritance/docs/Inheritance.txt Log: Minor fix for SQLObject 0.6 API. Modified: home/phd/SQLObject/inheritance/docs/Inheritance.txt =================================================================== --- home/phd/SQLObject/inheritance/docs/Inheritance.txt 2004-12-16 14:23:02 UTC (rev 491) +++ home/phd/SQLObject/inheritance/docs/Inheritance.txt 2004-12-16 14:23:48 UTC (rev 492) @@ -55,7 +55,7 @@ p = Person(firstName='John', lastName='Doe') e = Employee(firstName='Jane', lastName='Doe', position='Chief') - p2 = Person(1) + p2 = Person.get(1) Will create the following data in the database:: @@ -97,8 +97,8 @@ The SQLObject q magic also work. Using this select are valid:: - Employee.select(Employee.q.firstName == 'Jane' & Employee.q.position == 'Chief') will return Jane Doe - Employee.select(Person.q.firstName == 'Jane' & Employee.q.position == 'Chief') will return Jane Doe + Employee.select(AND(Employee.q.firstName == 'Jane' Employee.q.position == 'Chief')) will return Jane Doe + Employee.select(AND(Person.q.firstName == 'Jane', Employee.q.position == 'Chief')) will return Jane Doe Employee.select(Employee.q.lastName == 'Doe') will only return Jane Doe (as Joe isn't an employee) Person.select(Person.q.lastName == 'Doe') will return both entries. |