mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Fixed #32231 -- Allowed passing None params to QuerySet.raw().
This commit is contained in:
committed by
Mariusz Felisiak
parent
aa3d360631
commit
415f50298f
@@ -818,7 +818,7 @@ class QuerySet:
|
||||
# PUBLIC METHODS THAT RETURN A QUERYSET SUBCLASS #
|
||||
##################################################
|
||||
|
||||
def raw(self, raw_query, params=None, translations=None, using=None):
|
||||
def raw(self, raw_query, params=(), translations=None, using=None):
|
||||
if using is None:
|
||||
using = self.db
|
||||
qs = RawQuerySet(raw_query, model=self.model, params=params, translations=translations, using=using)
|
||||
@@ -1419,14 +1419,14 @@ class RawQuerySet:
|
||||
Provide an iterator which converts the results of raw SQL queries into
|
||||
annotated model instances.
|
||||
"""
|
||||
def __init__(self, raw_query, model=None, query=None, params=None,
|
||||
def __init__(self, raw_query, model=None, query=None, params=(),
|
||||
translations=None, using=None, hints=None):
|
||||
self.raw_query = raw_query
|
||||
self.model = model
|
||||
self._db = using
|
||||
self._hints = hints or {}
|
||||
self.query = query or sql.RawQuery(sql=raw_query, using=self.db, params=params)
|
||||
self.params = params or ()
|
||||
self.params = params
|
||||
self.translations = translations or {}
|
||||
self._result_cache = None
|
||||
self._prefetch_related_lookups = ()
|
||||
|
||||
Reference in New Issue
Block a user