Because I really dig the way SO handles relations. I am writing a POS for the mac with PyObjC and I need to handle a lot of relations. To give an example:

# Make a new order
order = Order(date=now())

# Connect a person
order.person = Person.get(3)

# Add a few products
order.addProducts(Product.get(278))
order.addProducts(Product.get(256))
order.addProducts(Product.get(78))

This makes things very easy.


On 31-aug-2005, at 16:13, Joćo Paulo Fernandes Farias wrote:

In a case like this, why not using python sql interface, and use the "select x, y from t where z='what'"?

--
JP

On 8/31/05, Oleg Broytmann <phd@mail2.phd.pp.ru> wrote:
On Wed, Aug 31, 2005 at 06:08:01PM +0400, Oleg Broytmann wrote:
> a, b = conn.queryOne(conn.sqlrepr(
>    Select(MyTable.q.a, MyTable.q.b, MyTable.q.c == "filterByMe")
> ))

   Ahem, sorry...

a, b = conn.queryOne(conn.sqlrepr(
   Select([MyTable.q.a, MyTable.q.b], MyTable.q.c == "filterByMe")
))

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss


Download my V-Card