On May 10, 2008, at 5:32 AM, Werner F. Bruhin wrote:

>
> Michael,
>
> Thanks for the quick reply, I needed a bit of time to be able to get
> some more data on this.
>
> Michael Bayer wrote:
>> ...
>> uh it depends on what "object.otherviewofsubobject" is...is that a
>> relation() ?  a python descriptor ?  if the latter, how does it
>> work ?  where does it get context from ?   seems like this is a  
>> simple
>> issue of issuing a SELECT on a connection outside of the current
>> transaction.
>>
> They are both relation.  Ok, here some test code showing the  
> problem, I
> hope this will allow you to give me some pointers.
>
> consevent = session.query(db.consevent).get(1)
> conseventMU = consevent.conseventmu
> conseventMUview = consevent.vconseventmu
> print 'conseventmu'
> for item in conseventMU:
>    print item
> print 'conseventmu-VIEW'
> for item in conseventMUview:
>    print item
>

you need the refresh() to cascade onto the objects present in the  
"vconseventmu" collection, so set  'vconseventmu' as  
sao.relation(Vconseventmu, cascade="save-update, merge, refresh- 
expire").


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to