Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Replace RawQuery with compiler.results_iter()
Browse files Browse the repository at this point in the history
This originated with behavior seen in Avocado where data was being shifted.
It was discovered to be the Oracle ROWNUM identifier that was prepended to
each row. See chop-dbhi/avocado#98

Fix #8
  • Loading branch information
bruth committed Jun 6, 2013
1 parent 05cc7db commit e4772ce
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modeltree/query.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.db.models import query
from django.db.models.sql import RawQuery
from modeltree.tree import trees
from modeltree.utils import M

Expand Down Expand Up @@ -33,5 +32,5 @@ def select(self, *fields, **kwargs):
return self.tree.add_select(queryset=queryset, *fields, **kwargs)

def raw(self):
sql, params = self.query.get_compiler(self.db).as_sql()
return RawQuery(sql, self.db, params)
compiler = self.query.get_compiler(self.db)
return compiler.results_iter()

0 comments on commit e4772ce

Please sign in to comment.