#23313: RawQuery.__repr__ fails when params passed as dict
----------------------------------------------+-----------------------
     Reporter:  movEAX                        |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  master
     Severity:  Normal                        |   Keywords:  raw query
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+-----------------------
 {{{
 In [1]: from django.db.models.sql.query import RawQuery

 In [2]: raw_query = RawQuery('SELECT %(foo)s', None, {'foo': 'bar'})

 In [3]: repr(raw_query)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-3-7fb02908cd64> in <module>()
 ----> 1 repr(raw_query)

 /home/user/.src/django/django/db/models/sql/query.py in __repr__(self)
      84
      85     def __repr__(self):
 ---> 86         return "<RawQuery: %r>" % (self.sql % tuple(self.params))
      87
      88     def _execute_query(self):

 TypeError: format requires a mapping
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23313>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.80c396f1c67b8a944d6abfc0d8ec3436%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to