[storm] Query using count
Christopher Armstrong
radix at twistedmatrix.com
Wed Aug 8 19:51:05 BST 2007
On 8/8/07, akira <nhytro-python at web.de> wrote:
> columns = (parent.link, Count()-1)
> where = And(node.lft > parent.lft, node.lft < parent.rgt)
> expr = Select(columns, where, order_by=node.lft)
>
> test = SQL(("%s") % expr)
>
> this gives me this:
>
> <storm.expr.SQL object at 0x009F0230>
>
> Which is not a result set, does this have to be executed?
You probably don't want to pass that expression to 'SQL'. Just pass it
to store.execute (without stringifying it). store.execute(expr)
--
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/
More information about the storm
mailing list