~ack/storm/resultset-get-query

« back to all changes in this revision

Viewing changes to storm/store.py

  • Committer: Alberto Donato
  • Date: 2012-11-13 09:03:54 UTC
  • Revision ID: alberto.donato@canonical.com-20121113090354-vswr1cj9wykojkp2
Use the Connection compile function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from storm.expr import (
34
34
    Expr, Select, Insert, Update, Delete, Column, Count, Max, Min,
35
35
    Avg, Sum, Eq, And, Asc, Desc, compile_python, compare_columns, SQLRaw,
36
 
    Union, Except, Intersect, Alias, SetExpr, State, compile)
 
36
    Union, Except, Intersect, Alias, SetExpr, State)
37
37
from storm.exceptions import (
38
38
    WrongStoreError, NotFlushedError, OrderLoopError, UnorderedError,
39
39
    NotOneError, FeatureError, CompileError, LostObjectError, ClassInfoError)
1480
1480
        @return: A tuple with the query and its parameters.
1481
1481
        """
1482
1482
        s = State()
1483
 
        query = compile(self._get_select(), s)
 
1483
        query = self._store._connection.compile(self._get_select(), s)
1484
1484
        params = tuple(param.get() for param in s.parameters)
1485
1485
        return query, params
1486
1486