[sqlalchemy] Re: sqlalchemy and postgresql warning messages

2007-11-20 Thread Manlio Perillo
Michael Bayer ha scritto: On Nov 16, 2007, at 1:54 PM, Manlio Perillo wrote: There is an error in the schema, b.id is of type String instead of type Integer. Unfortunately PostgreSQL does not raises an error, but just a warning. In fact I have found such a problem in one of my

[sqlalchemy] filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Gaetan de Menten
Hi people, I have some classes with standard python properties which target another python object and also uses several columns in the database. I also got a global factory function to create an instance of that target object out of the value of the columns (the class of that target object can

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread svilen
On Tuesday 20 November 2007 11:37:29 Gaetan de Menten wrote: Hi people, I have some classes with standard python properties which target another python object and also uses several columns in the database. I also got a global factory function to create an instance of that target object out

[sqlalchemy] Merge Questions

2007-11-20 Thread Koen Bok
I have some questions about pickling/merging objects. I have written example code to demonstrate: http://pastie.caboo.se/120146 Kindest regards, Koen Bok --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Chris M
I think it's a good idea, if Mike agrees then I will submit a patch to do this later today. (Except MyClass.my_prop and my_prop_name won't be equiv, you'll have to have whatever your property returns support __eq__) On Nov 20, 4:37 am, Gaetan de Menten [EMAIL PROTECTED] wrote: Hi people, I

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Gaetan de Menten
On Nov 20, 2007 3:12 PM, Chris M [EMAIL PROTECTED] wrote: I think it's a good idea, if Mike agrees then I will submit a patch to do this later today. (Except MyClass.my_prop and my_prop_name won't be equiv, I never said that's what I wanted. Notice that in my example, i speak about filter

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Gaetan de Menten
On Nov 20, 2007 11:51 AM, svilen [EMAIL PROTECTED] wrote: On Tuesday 20 November 2007 11:37:29 Gaetan de Menten wrote: Hi people, I have some classes with standard python properties which target another python object and also uses several columns in the database. I also got a global

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Chris M
I actually deleted my post on further consideration of this problem, I guess it lagged a bit so you got to it :) If this was implemented I'd rather it work with a new MapperProperty that takes the name of the attribute on the class to access instead of automatically detecting which attributes on

[sqlalchemy] Re: sqlalchemy and postgresql warning messages

2007-11-20 Thread Michael Bayer
On Nov 20, 2007, at 4:35 AM, Manlio Perillo wrote: I have asked on the psycopg2 list. psycopg2 connection has a notices attribute. try: conn = db.connect() metadata.create_all(bind=conn) print conn.connection.connection.notices finally: metadata.drop_all()

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Michael Bayer
On Nov 20, 2007, at 4:37 AM, Gaetan de Menten wrote: Hi people, I have some classes with standard python properties which target another python object and also uses several columns in the database. I also got a global factory function to create an instance of that target object out of

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread Gaetan de Menten
On Nov 20, 2007 5:23 PM, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 20, 2007, at 4:37 AM, Gaetan de Menten wrote: I have some classes with standard python properties which target another python object and also uses several columns in the database. I also got a global factory function

[sqlalchemy] Re: Merge Questions

2007-11-20 Thread Koen Bok
Aight, thanks for the explanation! Koen On Nov 20, 5:02 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 20, 2007, at 6:19 AM, Koen Bok wrote: I have some questions about pickling/merging objects. I have written example code to demonstrate:http://pastie.caboo.se/120146 Kindest

[sqlalchemy] Sum with Grouping

2007-11-20 Thread Matt Haggard
I'm very new to sqlalchemy and I'm still trying to wrap my head around how it works. I have a table with columns: type, amount. I want to sum the amounts grouped by type. In SQL I would write: SELECT sum(amount), type from purchases group by type; How do I do this with SQLAlchemy? This is

[sqlalchemy] Re: Sum with Grouping

2007-11-20 Thread Michael Bayer
the aggregate methods on Query, such as apply_sum(), apply_avg(), etc., are not in such great shape right now...they've been neglected and in fact aren't even working correctly with GROUP BY, etc...I've added trac ticket #876 for this. If you know the exact SQL and columns you'd like to get