Skip to content
This repository
Browse code

adding a raw sql method

  • Loading branch information...
commit a5ec7bb90b1882db95c6f4eae94ea373f7f6a50f 1 parent 3aa06e8
Charles Leifer authored October 11, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  peewee.py
4  peewee.py
@@ -2089,3 +2089,7 @@ def dfs(model):
2089 2089
     for m in sorted(models, key=names, reverse=True):
2090 2090
         dfs(m)
2091 2091
     return list(reversed(ordering))  # want parents first in output ordering
  2092
+
  2093
+def raw_sql(query):
  2094
+    db = query.model_class._meta.database
  2095
+    return query.sql(db.get_compiler())

0 notes on commit a5ec7bb

Please sign in to comment.
Something went wrong with that request. Please try again.