On Jan 3, 2009, at 7:31 PM, Eoghan Murray wrote:

>
> On Jan 3, 2:44 am, Michael Bayer <mike...@zzzcomputing.com> wrote:
>>
>> I've made fixes to corresponding_column() to resolve this issue, and
>> in the process uncovered (and also solved) a whole class of problems
>> in that method which was, to my great surprise, also impacting some
>> very nested Query objects that *don't* use union() or anything
>> compound.     This change is in trunk r5578.
>
> Brilliant, this has done the trick.
>
> Incidentally, I had to hack the ids in order to get the O-R mapper to
> pick up two rows with the same id:
>
> u = union(
>             MyE.__table__.select(),
>             select([MyE.id - 1000000, MyE.f_2.label('f_1'),
> MyE.f_1.label('f_2'), MyE.date])
>         )
>
> Ideally I'd like to select NULL/None for the id in the second SELECT
> as the objects do not correspond to any rows which exist in the DB
> (they are readonly).

the ORM can't represent a mapped instance with a totally null primary  
key, or two of the same instance with the same primary key.  so if you  
wanted those rows you'd have to select individual columns.

--~--~---------~--~----~------------~-------~--~----~
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 email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to