diff options
| author | Shai Berger <shai@platonix.com> | 2013-06-28 06:15:03 +0300 |
|---|---|---|
| committer | Shai Berger <shai@platonix.com> | 2013-06-28 06:59:10 +0300 |
| commit | d097417025e71286ad5bbde6e0a79caacabbbd64 (patch) | |
| tree | 007c58c8787cee32cf68d08683b7c5294e8a4ad1 /django/db/models | |
| parent | 7c0b72a826a3637b30a57553ac83f6b913c33134 (diff) | |
Support 'pyformat' style parameters in raw queries, Refs #10070
Add support for Oracle, fix an issue with the repr of RawQuerySet,
add tests and documentations. Also added a 'supports_paramstyle_pyformat'
database feature, True by default, False for SQLite.
Thanks Donald Stufft for review of documentation.
Diffstat (limited to 'django/db/models')
| -rw-r--r-- | django/db/models/query.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index b0ce25f5b5..27a87a3f65 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1445,7 +1445,10 @@ class RawQuerySet(object): yield instance def __repr__(self): - return "<RawQuerySet: %r>" % (self.raw_query % tuple(self.params)) + text = self.raw_query + if self.params: + text = text % (self.params if hasattr(self.params, 'keys') else tuple(self.params)) + return "<RawQuerySet: %r>" % text def __getitem__(self, k): return list(self)[k] |
