[sqlalchemy] query doctest

2008-11-29 Thread sandro dentella
Hi, in a doctest I have:: str(q) == str(query.filter(User.first_name == 'ed')) True that works but the following fails, (both where built starting from the same session.query(User) q == query.filter(User.first_name == 'ed') True in another place comparing str fails just because a join

[sqlalchemy] metadata reflecting all schemas

2008-11-29 Thread [EMAIL PROTECTED]
Hi I was wondering if there was a way to reflect all schemas in the metadata, or get a list of schemas in the database with out querying the catalog for postgresql. Regards, Jar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[sqlalchemy] Re: metadata reflecting all schemas

2008-11-29 Thread [EMAIL PROTECTED]
Or maybe this is my problem /home/jchesney/workspace/sqlalchemy/lib/sqlalchemy/engine/base.py: 1237: SAWarning: Did not recognize type 'name' of column 'USERNAME' self.dialect.reflecttable(conn, table, include_columns) /home/jchesney/workspace/sqlalchemy/lib/sqlalchemy/engine/base.py: 1237:

[sqlalchemy] Re: query doctest

2008-11-29 Thread Michael Bayer
On Nov 29, 2008, at 6:22 AM, sandro dentella wrote: Hi, in a doctest I have:: str(q) == str(query.filter(User.first_name == 'ed')) True that works but the following fails, (both where built starting from the same session.query(User) q == query.filter(User.first_name == 'ed') True

[sqlalchemy] Re: New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-11-29 Thread Doug Farrell
Sorry, I didn't realize I had done that, I thought I had started a new post. My apologies. -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, November 28, 2008 11:45 PM To: sqlalchemy Subject: [sqlalchemy] Re:

[sqlalchemy] New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-11-29 Thread Doug Farrell
Hi all, I'm having a problem with a new instance of a relation conflicting with an existing instance. I'm using SA 0.5rc with Sqlite3. Here are my simplified classes: class Stat(sqladb.Base): __tablename__ = stats name = Column(String(32), primary_key=True)

[sqlalchemy] Re: metadata reflecting all schemas

2008-11-29 Thread Michael Bayer
the type is not recognized but the reflection operation should succeed. thats why you're only getting a warning on those. On Nov 29, 2008, at 8:00 AM, [EMAIL PROTECTED] wrote: Or maybe this is my problem /home/jchesney/workspace/sqlalchemy/lib/sqlalchemy/engine/base.py: 1237:

[sqlalchemy] Re: metadata reflecting all schemas

2008-11-29 Thread [EMAIL PROTECTED]
Thanks Michael If its just a warning and its supposed to continue past it, Why doesn't it finish reflecting all the tables in all the schemas instead of a few tables in two schemas. I think it retrieved all the tables in the first schema which i specified and followed the foreign keys to

[sqlalchemy] Re: metadata reflecting all schemas

2008-11-29 Thread Michael Bayer
On Nov 29, 2008, at 6:05 PM, [EMAIL PROTECTED] wrote: Thanks Michael If its just a warning and its supposed to continue past it, Why doesn't it finish reflecting all the tables in all the schemas instead of a few tables in two schemas. that would be a different issue. But I would note

[sqlalchemy] Re: New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-11-29 Thread Michael Bayer
Simon's suggestion about the duplicate name still holds. Your relation from Stat-ExtraStat currently needs to be one-to-one since you cannot have more than one ExtraStat referencing a single Stat, due to the PK constraint on ExtraStat.name. The error is raising at the point of query()