On Tue, Sep 4, 2012 at 4:45 PM, Michael Bayer <mike...@zzzcomputing.com> wrote:
> they're in tip.   thanks for testing all this !


Great!


Another issue, with "contains" this time:



----
from sqlalchemy.types import UserDefinedType


class Geometry(UserDefinedType):

    class comparator_factory(UserDefinedType.Comparator):

        def contains(self, other):
            return self.op('~')(other)


from sqlalchemy import Table, Column, MetaData

lakes = Table('lake', MetaData(),
    Column('geom', Geometry)
    )

print str(lakes.c.geom.contains('POINT(1 2)'))
----



produces this error:


Traceback (most recent call last):
  File "comparator_factory.py", line 18, in <module>
    print str(lakes.c.geom.contains('POINT(1 2)'))
  File "/home/elemoine/src/sqlalchemy/lib/sqlalchemy/sql/operators.py",
line 375, in contains
    return self.operate(contains_op, other, **kwargs)
  File "/home/elemoine/src/sqlalchemy/lib/sqlalchemy/sql/expression.py",
line 2204, in operate
    return op(self.comparator, *other, **kwargs)
  File "/home/elemoine/src/sqlalchemy/lib/sqlalchemy/sql/operators.py",
line 571, in contains_op
    return a.contains(b, escape=escape)
TypeError: contains() got an unexpected keyword argument 'escape'


I should be able to override "contains", no?






-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

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