Hi,
I have a mapping between a table row and a python field, for which I have a
synonym. I've read the documentation and it says: "Each of
column_property(), composite(), relationship(), and comparable_property()
accept an argument called comparator_factory." For which I assume that
synonym() doesn't have a comparator_factory, however when I peeked into the
library's code I saw this definition:
def synonym(name, map_column=False, descriptor=None,
comparator_factory=None, doc=None):
Does this means that you can actually customize a comparator_factory for
synonym? I ask because in my "proxied" mapped column I have a custom
comparator_factory which defines a "method" for that property so I can do
something like filter(my_prop.my_method()). However, this method doesn't get
proxied by orm.synonym, with or without defining the same comparator_factory
in orm.synonym(). Part of my mapper is:
'_geolocation': orm.composite(GeoPoint, event.c.GeoLatitude,
event.c.GeoLongitude,
comparator_factory=GeoPointComparator),
'geolocation': orm.synonym('_geolocation',
comparator_factory=GeoPointComparator)
I really don't have a problem using filter(Klass._geolocation.near(param1,
param2)) for my code (near being defined in GeoPointComparator). I made this
post to see if someone with more insight can help to clarify this, so that I
don't have to peek very deeply into the code in order to look for the answer
of this behavior.
Thanks
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/Z8N3-mIpxg0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.