Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 5:38 PM, Michael Bayer wrote: > > On Sep 4, 2012, at 11:32 AM, Eric Lemoine wrote: > >> On Tue, Sep 4, 2012 at 5:30 PM, Michael Bayer >> wrote: >>> >>> On Sep 4, 2012, at 11:24 AM, Eric Lemoine wrote: >>> On Tue, Sep 4, 2012 at 5:20 PM, Eric Lemoine wrote: >

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Michael Bayer
On Sep 4, 2012, at 11:32 AM, Eric Lemoine wrote: > On Tue, Sep 4, 2012 at 5:30 PM, Michael Bayer > wrote: >> >> On Sep 4, 2012, at 11:24 AM, Eric Lemoine wrote: >> >>> On Tue, Sep 4, 2012 at 5:20 PM, Eric Lemoine >>> wrote: On Tue, Sep 4, 2012 at 5:18 PM, Michael Bayer wrote: >>>

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 5:30 PM, Michael Bayer wrote: > > On Sep 4, 2012, at 11:24 AM, Eric Lemoine wrote: > >> On Tue, Sep 4, 2012 at 5:20 PM, Eric Lemoine >> wrote: >>> On Tue, Sep 4, 2012 at 5:18 PM, Michael Bayer >>> wrote: can't do __contains__ due to Python behavior: class F

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Michael Bayer
On Sep 4, 2012, at 11:24 AM, Eric Lemoine wrote: > On Tue, Sep 4, 2012 at 5:20 PM, Eric Lemoine > wrote: >> On Tue, Sep 4, 2012 at 5:18 PM, Michael Bayer >> wrote: >>> can't do __contains__ due to Python behavior: >>> >>> class Foo(object): >>>def __add__(self, other): >>>return (

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 5:20 PM, Eric Lemoine wrote: > On Tue, Sep 4, 2012 at 5:18 PM, Michael Bayer > wrote: >> can't do __contains__ due to Python behavior: >> >> class Foo(object): >> def __add__(self, other): >> return (self, "add", other) >> >> def __contains__(self, other):

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 5:18 PM, Michael Bayer wrote: > can't do __contains__ due to Python behavior: > > class Foo(object): > def __add__(self, other): > return (self, "add", other) > > def __contains__(self, other): > return (self, "contains", other) > > f1 = Foo() > > ass

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Michael Bayer
can't do __contains__ due to Python behavior: class Foo(object): def __add__(self, other): return (self, "add", other) def __contains__(self, other): return (self, "contains", other) f1 = Foo() assert f1 + 5 == (f1, "add", 5) assert 5 in f1 == (f1, "contains", 5), 5 in

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 4:45 PM, Michael Bayer 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.Comparat

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Michael Bayer
they're in tip. thanks for testing all this ! On Sep 4, 2012, at 10:40 AM, Eric Lemoine wrote: > On Tue, Sep 4, 2012 at 4:36 PM, Michael Bayer > wrote: >> Those methods aren't part of the contract at the moment but I can add them >> in. > > > I can live without them, it'd just be nice to

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
On Tue, Sep 4, 2012 at 4:36 PM, Michael Bayer wrote: > Those methods aren't part of the contract at the moment but I can add them in. I can live without them, it'd just be nice to be able to use the actual PostGIS operators in SQLAlchemy apps. Thank you! -- Eric Lemoine Camptocamp France S

Re: [sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Michael Bayer
Those methods aren't part of the contract at the moment but I can add them in. On Sep 4, 2012, at 10:30 AM, Eric Lemoine wrote: > Hi > > I'm trying to add __lshift__ and __rshift__ to my (now well known :) > Geometry's comparator_factory, but it looks like SQLAlchemy isn't > happy with it. > >

[sqlalchemy] comparator_factory __lshift__ __rshift__

2012-09-04 Thread Eric Lemoine
Hi I'm trying to add __lshift__ and __rshift__ to my (now well known :) Geometry's comparator_factory, but it looks like SQLAlchemy isn't happy with it. from sqlalchemy.types import UserDefinedType class Geometry(UserDefinedType): class comparator_factory(UserDefinedType.Comparator)