Re: [sqlalchemy] Re: unable to understand this error

2010-02-17 Thread anusha kadambala
hi werner, Thanks for the help.It is working fine now. On Tue, Feb 16, 2010 at 9:11 PM, werner wbru...@free.fr wrote: On 16/02/2010 15:48, Krishnakant Mane wrote: On Tuesday 16 February 2010 07:01 PM, avdd wrote: Now the specific problem you see is that the ORM uses the declared

[sqlalchemy] self referential with 2 forign key constraints

2010-02-17 Thread cropr
I have defined a self refential class ContentObject to build a node tree wih parent child relationships. class ContentObject(Base): __tablename__ = 'contentobject' _contentType = 'contentobject' id = Column(types.Integer, primary_key=True, autoincrement=True) parent_id =

Re: [sqlalchemy] inner join and ambiguous columns

2010-02-17 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: On Feb 16, 2010, at 7:07 PM, Manlio Perillo wrote: Michael Bayer ha scritto: [...] just so I can understand fully can you modify the paste I sent to illustrate exactly how the results are happening, as that can help me

Re: [sqlalchemy] inner join and ambiguous columns

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 8:58 AM, Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: On Feb 16, 2010, at 7:07 PM, Manlio Perillo wrote: Michael Bayer ha scritto: [...] just so I can understand fully can you modify the paste I sent to illustrate

[sqlalchemy] another problem with complex join

2010-02-17 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I have found another limitation of SQLAlchemy, when handling joins. The code is here: http://paste.pocoo.org/show/179286/ I get: sqlalchemy.exc.ArgumentError: Can't determine join between 'Join object on Join object on content_types(159586732)

Re: [sqlalchemy] another problem with complex join

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 9:19 AM, Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I have found another limitation of SQLAlchemy, when handling joins. The code is here: http://paste.pocoo.org/show/179286/ I get: sqlalchemy.exc.ArgumentError: Can't determine join

Re: [sqlalchemy] inner join and ambiguous columns

2010-02-17 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: [...] By the way, I have found an incorrect behaviour in SQLAlchemy, when the select column list is empty. query = sql.select( None, contents.c.slug == 'python', from_obj=[join]) SQLAlchemy generates an

Re: [sqlalchemy] another problem with complex join

2010-02-17 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: On Feb 17, 2010, at 9:19 AM, Manlio Perillo wrote: Hi. I have found another limitation of SQLAlchemy, when handling joins. The code is here: http://paste.pocoo.org/show/179286/ I get:

[sqlalchemy] How to return object with maximum column via a mapper?

2010-02-17 Thread Hermann Himmelbauer
Hi, I have the following many to one relation: - A bank account table (acc) - An Interest rate table, which relates to the account table. Colums are an ID, a rate (decimal), a date and a flag outlining if the interest rate is credit or debit ('H' / 'S') - One account may have multiple interest

[sqlalchemy] How to use session to update record (newbie)

2010-02-17 Thread mando
Hi to alls, still now I use this method to update values in my table: table.update(table.c.table_name, 'id_table' == 1').execute({'field_1': 'new_value'})) But now I want to use session. I look around the web and this list but I don't understand how to do it. Session =

[sqlalchemy] Re: How to use session to update record (newbie)

2010-02-17 Thread Domingo Aguilera
This is one example... session.query(YourClass).update(values = dict(tag = a)) the previous one modifies field named tag to a for every record. You can filter before doing update. For example... from sqlalchemy.sql import and_ session.query(YourClass).filter(and_(YourClass.field1 == any

Re: [sqlalchemy] self referential with 2 forign key constraints

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 6:15 AM, cropr wrote: I have defined a self refential class ContentObject to build a node tree wih parent child relationships. class ContentObject(Base): __tablename__ = 'contentobject' _contentType = 'contentobject' id = Column(types.Integer,

Re: [sqlalchemy] inner join and ambiguous columns

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 9:56 AM, Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: [...] By the way, I have found an incorrect behaviour in SQLAlchemy, when the select column list is empty. query = sql.select( None, contents.c.slug ==

Re: [sqlalchemy] another problem with complex join

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 10:25 AM, Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: On Feb 17, 2010, at 9:19 AM, Manlio Perillo wrote: Hi. I have found another limitation of SQLAlchemy, when handling joins. The code is here:

Re: [sqlalchemy] How to return object with maximum column via a mapper?

2010-02-17 Thread Michael Bayer
On Feb 17, 2010, at 12:27 PM, Hermann Himmelbauer wrote: Hi, I have the following many to one relation: - A bank account table (acc) - An Interest rate table, which relates to the account table. Colums are an ID, a rate (decimal), a date and a flag outlining if the interest rate is