is_modified fails if the mapped class has a synonym attribute

Issue #1550 resolved
Former user created an issue

In SQLAlchemy 0.4.8, the is_modified function of session is failing when the mapped class has a synonym attribute.

Note that the bug is not present in SA 0.5.6.

The attached program reproduce the problem and has the following output :

$ python sabug_is_modified_fails_with_synonym.py Traceback (most recent call last):
  File "sabug_is_modified_fails_with_synonym.py", line 34, in <module>
    print object_session(instance).is_modified(instance, include_collections=False)
  File "/home/cdevienne/tmp/sa05/lib/python2.5/site-packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/orm/session.py", line 1195, in is_modified
    (added, unchanged, deleted) = attr.get_history(instance)
  File "/home/cdevienne/tmp/sa05/lib/python2.5/site-packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/orm/attributes.py", line 47, in get_history
    return self.impl.get_history(instance._state, **kwargs)
AttributeError: 'ProxyImpl' object has no attribute 'get_history'

Comments (5)

  1. Former user Account Deleted

    Forgot to add my mail as a CC... I am Christophe de Vienne, and my email is cdevienne@gmail.com if you have any question.

    Christophe

  2. Log in to comment