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 let you do:
def _python_is_visible(self):
return (self.enabled and not self.is_deleted)
def _sql_is_visible(self):
return (self.enabled == True) & (self.is_deleted == False)
is_visible = some_magic(_python_is_visible,_sql_is_visible)
cheers,
Chris
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
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.