On May 28, 2014, at 6:42 AM, Ladislav Lenart <lenart...@volny.cz> wrote:

> On 27.5.2014 22:09, Michael Bayer wrote:
>> some improvement was made to this formatting in 0.8 or so, though even now 
>> it's not very easy to read directly.   
>> 
>> Typically I try to look at the classes and relationships being mentioned in 
>> the error and then inspect the mappings.  In this case it appears like the 
>> cycle is just on the Partner class and the "bazaar" relationship alone.   
>> Almost as though maybe you set a Partner.bazaar to be "self", e.g. pointing 
>> to itself.
> 
> Thank you for the explanation.
> 
> I suspected that the cycles attribute tells me everything I need to know.
> 
> You are also right about the following assertion:
> 
>    # p is a Partner.
>    p.bazaar is p # True
> 
> However the operation in question does not modify this attribute at all. This
> assertion is True before, during and after the operation. Does the error mean
> that the code is infact trying to modify the bazaar attribute? OR the error is
> triggered simply by the fact that a cycle exists no matter whether the
> particular relationship is being updated or not?

Well if you say something like "x.foo = bar", that triggers an attribute 
history event which will result in a UOW operation.   I'm not sure offhand if 
in the case of many-to-one how far it gets before it decides that no action is 
to be taken, or if it even does so, it might do an UPDATE unconditionally in 
some cases for m2o as we don't always emit a load for the "previous" value in 
the interests of performance in the majority of cases. 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to