We have a "Users" model with this, which was a hybrid property to wrap the
"email" column temporarily. The database column (MySQL 5.7) is "email",
but defined by ORM as "_email", with an "email" hybrid property to access
and set:
_email = Column(u'email', String(255))
...
@hybrid_property
def email(self):
return self._email.replace("olddomain.com", "newdomain.com")
@email.setter
def email_setter(self, val):
self._email = val
In 1.1.18, something like "self.email = someEmailAddress" works fine. We're
testing an upgrade to 1.3.11, and that now throws an "AttributeError: can't set
attribute" from hybrid.py __set__().
That seems to be at a simple check "if self.fset is None", so it's almost as if
the decorator never stored the setter function? I'm digging into the hybrid
docs, and it seems a pretty innocuous setter, but there might be something
about it that
1.3 is being stricter about? I don't see any SAwarnings at startup that might
apply. I changed the getter to simply return self._email in case that was a
problem, but that didn't help.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/eb31b100-a9e1-4ddc-9b76-d8a7651bb4dc%40googlegroups.com.