[sqlalchemy] Re: Custom ID Generator

2009-09-27 Thread nkhalasi
My comments below. On Sep 25, 9:05 pm, Conor conor.edward.da...@gmail.com wrote: On Sep 25, 2:11 am, nkhalasi khal...@gmail.com wrote: def get_next_id():     session = meta.Session()     query = session.query(PKGenerator).filter_by (table_name='principals')     nxpkgen =

[sqlalchemy] Re: Declarative base - Joined Table Inheritence

2009-09-27 Thread Jarrod Chesney
I might be getting a bit ambitious here, But is this possible? I'm using a different polymorphic_on for the second level of inheritance. I tried it but it only seems to polymorphicly return records of type _UtConfReconcilerActions class _UtConfActions(Base): __tablename__ =

[sqlalchemy] Re: Custom ID Generator

2009-09-27 Thread Michael Bayer
On Sep 27, 2009, at 4:11 AM, nkhalasi wrote: My comments below. On Sep 25, 9:05 pm, Conor conor.edward.da...@gmail.com wrote: On Sep 25, 2:11 am, nkhalasi khal...@gmail.com wrote: def get_next_id(): session = meta.Session() query = session.query(PKGenerator).filter_by

[sqlalchemy] Re: Oracle and the Table Operator

2009-09-27 Thread Michael Bayer
On Sep 25, 2009, at 4:11 PM, Andrew wrote: So in a nut shell, its a function that uses the table operator to generate an *actual* table, with five named columns. While this is not great Oracle behavior, the PLSQL cannot be changed at this point in time. Now, after discussing this with

[sqlalchemy] How to get the instance back from a PropComparator?

2009-09-27 Thread Yuen Ho Wong
So I have this following code: class User(Base): class AgeComparator(PropComparator): def __lt__(self, other): pass def __gt__(self, other): pass def __eq__(self, other): pass def __ne__(self, other): return not (self == other)

[sqlalchemy] Re: How to get the instance back from a PropComparator?

2009-09-27 Thread Michael Bayer
On Sep 27, 2009, at 12:49 PM, Yuen Ho Wong wrote: So I have this following code: class User(Base): class AgeComparator(PropComparator): def __lt__(self, other): pass def __gt__(self, other): pass def __eq__(self, other): pass

[sqlalchemy] Re: Custom ID Generator

2009-09-27 Thread nkhalasi
Thanks Mike for the response. Comments below. On Sep 27, 6:47 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 27, 2009, at 4:11 AM, nkhalasi wrote: in theory, you want to say session.flush() so that n.next_id is   persisted but the transaction is not committed. However the

[sqlalchemy] Re: Custom ID Generator

2009-09-27 Thread nkhalasi
Comments below On Sep 27, 6:47 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 27, 2009, at 4:11 AM, nkhalasi wrote: in theory, you want to say session.flush() so that n.next_id is   persisted but the transaction is not committed. However the approach you have above wont work in

[sqlalchemy] Re: How to get the instance back from a PropComparator?

2009-09-27 Thread Yuen Ho Wong
Ah ha, so SQL expression operations are all translated directly to their appropriate SQL clauses. This makes sense I guess. Too bad this means I have to implement the same function twice, one in Python and another in SQL. Would be nice if there was some magic to morph custom properties to have

[sqlalchemy] Re: Error when trying to use a dict

2009-09-27 Thread BEES INC
phwoar, ok. I think I understand. To break it down: I have a class Foo which, among other things, contains a dict called vals with keys of dates and values of floats. When I store an instance of Foo, it goes to the foo table, and any items in the vals dict should go into the vals table. For

[sqlalchemy] Re: Error when trying to use a dict

2009-09-27 Thread Michael Bayer
BEES INC wrote: phwoar, ok. I think I understand. To break it down: I have a class Foo which, among other things, contains a dict called vals with keys of dates and values of floats. When I store an instance of Foo, it goes to the foo table, and any items in the vals dict should go into