Jon Nelson wrote:
>
> I have a pair of objects which share a relationship.
> The relationship is currently defined with dynamic_loader, and is a
> one:many.
> One particular use-case is this:
>
> objectA.things_of_type_B = list()
>
> which appears to work, sorta. When I manipulate objects of type B like
> this:
> B.a_thing = an_instance_of_A
> (this is the backref from the dynamic_loader)
> sqlalchemy re-loads the things_of_type_B relationship.
>
> if I do it this way:
>
> objectA.things_of_type_B.delete()
>
> then things work great.
> If I were to use the relationship, 'things_of_type_B' for adding and
> removing individual items (without using the backref) I'd use it like
> this:
>
> objectA.things_of_type_B.append( instance_of_type_B )
>
> Now, to the meat of the question:
>
> I'm curious why objectA.things_of_type_B = list() sorta-kinda appears
> to work, but doesn't - and doesn't raise an error, either.

setting a dynamic to [] should have the desired effect or raise an error,
so that might be a bug if you can post a succinct test case to trac.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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