>
> The versioning example appears to be cautious about determining if there was 
> a net "change" present.    The good news is that we don't actually need the 
> "new" value of customer_ref when we create the historical entry, we need the 
> "current" entry, which should be present in the object's dict.   Within 
> create_version(), if we see no net change on column-based attributes, we 
> assume nothing changed.   All we really need to do is check all the 
> relationship() based attributes as well - I'll commit the attached patch 
> which adds:
>
>     if not obj_changed:
>         # not changed, but we have relationships.  OK
>         # check those too
>         for prop in obj_mapper.iterate_properties:
>             if isinstance(prop, RelationshipProperty) and \
>                 attributes.get_history(obj, prop.key).has_changes():
>                 obj_changed = True
>                 break
>

Great, that will work well.

Many thanks,
A.

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