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...

   @property
   def is_visible(self):
      return (self.enabled and not self.is_deleted)

   visible = enabled==True & is_deleted==False

You may need to wrap that into a method with the classproperty decorator...

But, it'd be nice to have one attribute of the object fulfil both roles, and I don't know how to do that :-S

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk

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