havent tried either of these, but you could try jacking up BindParamClause:
class CallableBind(sql.BindParamClause):
def __init__(self, callable, name):
super(CallableBind, self).__init__(name, None)
self.callable = callable
value = property(lambda s:s.callable())
s = foo.select(foo.c.bar == CallableBind(somecallable, 'val'))
that should run the callable not exactly on each execute but on each
compilation.
or maybe you could do it via types:
class CallableType(types.String):
def __init__(self, callable):
self.callable = callable
def convert_bind_param(self, value, e):
return self.callable()
s = foo.select(foo.c.bar == bindparam('val', None,
type=CallableType(somecallable))
just some ideas.
Florian Boesch wrote:
> can I construct a select which gets the value it selects against from a
> callable
> each time it is executed?
>
> i.e.
>
> foo.select(foo.c.bar == fun(somecallable))
>
> cheers,
> Florian
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users