Synonym properties break when added through add_property
(original reporter: ged) Synonym properties added through add_property throw an exception when setting the attribute. I get the following traceback for the attached script. It might be related to ticket #831 (though I don't think it is).
Traceback (most recent call last):
File "test_synonym_sa.py", line 32, in <module>
f1.email = "x@y.com"
File "/home/ged/devel/sqlalchemy/trunk/lib/sqlalchemy/orm/attributes.py", line 91, in __set__
return self.user_prop.__set__(instance, value)
File "/home/ged/devel/sqlalchemy/trunk/lib/sqlalchemy/orm/mapper.py", line 560, in __getattribute__
return object.__getattribute__(self, key)
AttributeError: '_CompileOnAttr' object has no attribute '__set__'
Comments (8)
-
Account Deleted -
repo owner - changed status to resolved
this went better than expected, its the replacement of the old column property thats complex here, but actually its not complicated at all and works nicely, so aa71eed4e26914cbd2dea19676b7fddef13d938a.
-
Account Deleted - removed status
- changed status to open
(original author: ged)
-
Account Deleted (original author: ged) Doesn't work so nicely in fact. Here is an updated test case which shows that the (python) property is in fact not used.
-
Account Deleted - attached test_synonym_sa.2.py
(original author: ged) Updated test case
-
Account Deleted - attached test_synonym_sa.py
(original author: ged) Updated test case
-
Account Deleted (original author: ged) The correct test case is test_synonym_sa.py. There was a bug in .2.py.
-
repo owner - changed status to resolved
- Log in to comment
(original author: ged) btw, the traceback is for trunk as of now (0ec4e7d6b35685ba4b5d9e2053c765984b4a9189).