Ticket #14733: force_select_raw_queries.patch
File force_select_raw_queries.patch, 1.4 KB (added by , 14 years ago) |
---|
-
models/sql/query.py
30 30 A single raw SQL query 31 31 """ 32 32 33 def __init__(self, sql, using, params=None): 34 self.validate_sql(sql) 33 def __init__(self, sql, using, params=None, force=False): 34 if not force: 35 self.validate_sql(sql) 35 36 self.params = params or () 36 37 self.sql = sql 37 38 self.using = using -
models/query.py
1284 1284 Provides an iterator which converts the results of raw SQL queries into 1285 1285 annotated model instances. 1286 1286 """ 1287 def __init__(self, raw_query, model=None, query=None, params=None, 1287 def __init__(self, raw_query, model=None, query=None, params=None, force=False) 1288 1288 translations=None, using=None): 1289 1289 self.raw_query = raw_query 1290 1290 self.model = model 1291 1291 self._db = using 1292 self.query = query or sql.RawQuery(sql=raw_query, using=self.db, params=params )1292 self.query = query or sql.RawQuery(sql=raw_query, using=self.db, params=params, force=force) 1293 1293 self.params = params or () 1294 1294 self.translations = translations or {} 1295 1295