[sqlalchemy] Announcing Datahub 0.7

2009-01-11 Thread Lukasz Szybalski
http://lucasmanual.com/mywiki/DataHub *Datahub is a tool that allows faster download/crawl, parse, load, and visualize of data. It achieves this by allowing you to divide each step into its own work folders. In each work folder you get a sample files that you can start coding. *Datahub is for

[sqlalchemy] Re: how to "walk" through a query result

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 4:51 PM, Werner F. Bruhin wrote: > > I can not find the answer looking through the 0.5 doc for my problem. > > query = > session.query(db.SomeClass).filter(something).order_by(anorder) > > # get the first row > row = query.first() > > # display a dialog to the user > # one

[sqlalchemy] how to "walk" through a query result

2009-01-11 Thread Werner F. Bruhin
I can not find the answer looking through the 0.5 doc for my problem. query = session.query(db.SomeClass).filter(something).order_by(anorder) # get the first row row = query.first() # display a dialog to the user # one of the possible actions is to press a button which should show the next row

[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-11 Thread TJ Ninneman
> This has been corrected in http://www.sqlalchemy.org/trac/changeset/5641 > . I actually did both things, since using the cursor is the right > thing to do. Thats awesome, thanks so much for your time and help with this! TH --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-11 Thread Michael Trier
On Sat, Jan 10, 2009 at 9:54 PM, Michael Trier wrote: > 1. Override do_begin so that it creates a cursor and then executes on the >> cursor: >> >> def do_begin(self, connection): >> cursor = connection.cursor() >> cursor.execute("SET IMPLICIT_TRANSACTIONS OFF") >> curs

[sqlalchemy] Re: Self-Referential Mapping with Base?

2009-01-11 Thread Darren Govoni
Ahhh, looks like I'm on rc4. Let me try final and see. On Sun, 2009-01-11 at 13:10 -0500, Michael Bayer wrote: > 0.5.0 final ? > > On Jan 11, 2009, at 12:21 PM, Darren Govoni wrote: > > > > > Hi MikeCo, > > I tried your example, and got this error from SA 0.5. > > > > ValueError: need more tha

[sqlalchemy] Re: Self-Referential Mapping with Base?

2009-01-11 Thread Michael Bayer
0.5.0 final ? On Jan 11, 2009, at 12:21 PM, Darren Govoni wrote: > > Hi MikeCo, > I tried your example, and got this error from SA 0.5. > > ValueError: need more than 0 values to unpack > > Darren > > On Fri, 2009-01-09 at 20:33 -0800, MikeCo wrote: >> from sqlalchemy import * >> from sqlalchem

[sqlalchemy] Re: Self-Referential Mapping with Base?

2009-01-11 Thread Darren Govoni
Hi MikeCo, I tried your example, and got this error from SA 0.5. ValueError: need more than 0 values to unpack Darren On Fri, 2009-01-09 at 20:33 -0800, MikeCo wrote: > from sqlalchemy import * > from sqlalchemy.orm import * > from sqlalchemy.ext.declarative import declarative_base > > dbnam

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: > ArgumentError: Mapper 'Mapper|User|None' does not have a mapped_table > specified. (Are you using the return value of table.create()? It no > longer has a return value.) > > That's a really old error message, and I can see how its less than > perfect so I've just

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:41 AM, Christoph Zwerschke wrote: > > Michael Bayer schrieb: >> if Bar inherits from Foo, Foo is mapped to "foo_table", Bar has no >> table, Bar will be mapped to foo_table as well. > > In that case, no implicit name should be set or course. It should only > be set if a na

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Darren Govoni
Hehe. I just did it what you suggested and it doesn't work there either. If I leave off the limit 1, it produces expected results. So at least SA is consistent with PG at the moment, even if PG is broken. Going to post on their list now, about this. Thanks. On Sun, 2009-01-11 at 11:51 -0500, Mic

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:40 AM, Darren Govoni wrote: > > Sorry for the haze. I'm using PostgreSQL and am checking their docs on > isolation to see that it is consistent with SA. > > but here is a simplified example. > > I have 2 rows in the database with 1 column "FOO". Both rows have a > NULL >

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: > if Bar inherits from Foo, Foo is mapped to "foo_table", Bar has no > table, Bar will be mapped to foo_table as well. In that case, no implicit name should be set or course. It should only be set if a name cannot be figured out otherwise. > oh, this is entirely news to

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Darren Govoni
Sorry for the haze. I'm using PostgreSQL and am checking their docs on isolation to see that it is consistent with SA. but here is a simplified example. I have 2 rows in the database with 1 column "FOO". Both rows have a NULL value for column "FOO". Two programs, A and B. They are the same prog

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:18 AM, Darren Govoni wrote: > > Thank you, > > So I changed my query to a select/for update. then re-added the > updated > rows in the transaction, then committed. > > > works=session.query(Work).filter(tnow- > Work.taken filter > (Work.completed==None).limit(1).with_l

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Darren Govoni
Thank you, So I changed my query to a select/for update. then re-added the updated rows in the transaction, then committed. works=session.query(Work).filter(tnow-Work.taken > On Jan 11, 2009, at 10:44 AM, Darren Govoni wrote: > > > > > Hi, > > I have 2 records in the database. I made an expr

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:06 AM, Christoph Zwerschke wrote: > > Michael Bayer schrieb: >> As far as implicit tablename, it breaks the single inheritance >> scenario. but also besides that I made a comment on that here: >> >> http://www.sqlalchemy.org/trac/ticket/1270#comment:2 > > Thanks, I hadn't

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: > As far as implicit tablename, it breaks the single inheritance > scenario. but also besides that I made a comment on that here: > > http://www.sqlalchemy.org/trac/ticket/1270#comment:2 Thanks, I hadn't seen that. Not quite sure what you mean with single inheritance s

[sqlalchemy] Re: Does limit() work with update()?

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 10:44 AM, Darren Govoni wrote: > > Hi, > I have 2 records in the database. I made an expression to update only > 1 record, but all are getting updated. > > > works=session.query(Work).filter(tnow- > Work.taken .filter > (Work > .completed==None).limit(1).with_lockmode(mod

[sqlalchemy] Does limit() work with update()?

2009-01-11 Thread Darren Govoni
Hi, I have 2 records in the database. I made an expression to update only 1 record, but all are getting updated. works=session.query(Work).filter(tnow-Work.takenhttp://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 6:13 AM, Cito wrote: > > I wonder why declarative_base() doesn't simply set __tablename__ to > the name of the class by default (maybe translating camelcase to > lowercase with underscores), similar to how it is done in SQLObject > and Elixir. Also, the error message if you f

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Andreas Jung schrieb: > Please no implicit magic under the hood. You can have multiple mappers > for the same table. Citing Guido: explicit is better than implicit. You wouldn't be forced to use that magic, you could still set __tablename__ explictly. I understand your argument, but otoh "beauti

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11.01.2009 12:13 Uhr, Cito wrote: > I wonder why declarative_base() doesn't simply set __tablename__ to > the name of the class by default (maybe translating camelcase to > lowercase with underscores). Please no implicit magic under the hood. You

[sqlalchemy] Suggestions for abbreviations

2009-01-11 Thread Cito
I wonder why declarative_base() doesn't simply set __tablename__ to the name of the class by default (maybe translating camelcase to lowercase with underscores), similar to how it is done in SQLObject and Elixir. Also, the error message if you forget to set __tablename__ is misleading, it should m

[sqlalchemy] Re: session.query print sql

2009-01-11 Thread Jon Lees
Thanks alot,,that was what I needed, Jon > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send