[sqlalchemy] Bug in ORM: SA 0.5.5.

2009-08-17 Thread Jon Nelson
I'm pretty sure I've hit some sort of weird bug in SA's ORM module. I have a database which is autoreflected (sorry), and one of the tables is self-referential via foreign-key. Additionally, there is a database default and a NOT NULL constraint. This relationship is described as a relation named "

[sqlalchemy] Re: _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread chris e
Ticket created: #1507 Chris On Aug 17, 12:49 pm, Philip Jenvey wrote: > On Aug 17, 2009, at 12:01 PM, chris e wrote: > > > > > > > I'm not sure if this affects S.A 0.6. > > > It appears that orm.properties.RelationProperty. _post_init does not > > create a _dependency_processor attribute if th

[sqlalchemy] Re: _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread Philip Jenvey
On Aug 17, 2009, at 12:01 PM, chris e wrote: > > I'm not sure if this affects S.A 0.6. > > It appears that orm.properties.RelationProperty. _post_init does not > create a _dependency_processor attribute if the relation is viewonly. > > > Line1016: >if not self.viewonly: >self

[sqlalchemy] _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread chris e
I'm not sure if this affects S.A 0.6. It appears that orm.properties.RelationProperty. _post_init does not create a _dependency_processor attribute if the relation is viewonly. Line1016: if not self.viewonly: self._dependency_processor = dependency.create_dependency_processo

[sqlalchemy] Re: sql syntax for outerjoin in 0.3.7

2009-08-17 Thread Philip Jenvey
On Aug 17, 2009, at 2:48 AM, vindhyavasini wrote: > > hi all, > i am working on an open source project (http://project.askspree.de/) > i need to write this simple sql : > > SELECT tg_user.websites_specified AS tg_user_websites_specified, > tg_user.display_name AS tg_user_display_name, tg_user.c

[sqlalchemy] Re: renaming columns

2009-08-17 Thread Michele Simionato
On Aug 17, 5:31 pm, "King Simon-NFHD78" wrote: > I think you want something like .label('newcol'). For example: > >   import sqlalchemy as sa > >   print sa.select([atable.c.acolumn.label('newcol')]) Yep, exactly! --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: renaming columns

2009-08-17 Thread King Simon-NFHD78
> -Original Message- > From: sqlalchemy@googlegroups.com > [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato > Sent: 17 August 2009 16:11 > To: sqlalchemy > Subject: [sqlalchemy] renaming columns > > > There should be an easy way to do this, but I cannot find it in the

[sqlalchemy] renaming columns

2009-08-17 Thread Michele Simionato
There should be an easy way to do this, but I cannot find it in the documentation. I would like to generate a query with a renamed column, something like this: SELECT acolumn AS newcol FROM atable I tried things like print atable.select().with_only_columns([atable.c.acolumn.as_ ('newcol')]) Wh

[sqlalchemy] Re: new questions

2009-08-17 Thread King Simon-NFHD78
> -Original Message- > From: sqlalchemy@googlegroups.com > [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB > Sent: 17 August 2009 06:31 > To: sqlalchemy > Subject: [sqlalchemy] new questions > > > Hi- > I have just read a lot and gone through some exercises, but am at an >

[sqlalchemy] Re: too eager loading

2009-08-17 Thread Ants Aasma
On Aug 17, 12:41 pm, matiskiva wrote: > The problem being that i get a huge SQL statement with [effectively] > two joins, where the sequences and rects are joint to the detections. > It is very slow and creates extra data [as for every rect there is > also an occurance of sequence and so on] > Th

[sqlalchemy] too eager loading

2009-08-17 Thread matiskiva
Hi, Sorry for the stupid Subject, i just couldn't resist myself. I am a veteran SQL developer and new to SQLAlchemy, so i find myself often inspecting the generated SQL statements and thinking oh-my-god, this needs to change. Specifically, i came across an instance where multiple eager loading us

[sqlalchemy] sql syntax for outerjoin in 0.3.7

2009-08-17 Thread vindhyavasini
hi all, i am working on an open source project (http://project.askspree.de/) i need to write this simple sql : SELECT tg_user.websites_specified AS tg_user_websites_specified, tg_user.display_name AS tg_user_display_name, tg_user.created AS tg_user_created, tg_user.user_name AS tg_user_user_name