> -Original Message-
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers
> Sent: 08 July 2010 11:21
> To: sqlalchemy@googlegroups.com
> Subject: Re: [sqlalchemy] Comparable properties
>
> King Simon-NFHD78 wrote:
King Simon-NFHD78 wrote:
@hybrid
def is_visible(self):
return (self.enabled == True) & (self.is_deleted == False)
Yeah, having to write something that works as both plain python and a
sql layer construct seems a little brittle.
I wonder if a decorator could be knocked up which would
> -Original Message-
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers
> Sent: 08 July 2010 09:28
> To: sqlalchemy@googlegroups.com
> Subject: Re: [sqlalchemy] Comparable properties
>
> Oliver Beattie wrote:
>
Oliver Beattie wrote:
@property
def is_visible(self):
return (self.enabled and not self.is_deleted)
This can clearly be mapped quite easily to SQL expression
`Klass.enabled == True & Klass.is_deleted == False`
You could always add a class-level attribute that stored this...
@pr