#25947: Query's str() method fails when 'default' database is empty
-------------------------------------+-------------------------------------
     Reporter:  liboz                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.9
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by liboz):

 I looked into this a bit and Django seems to crash when running
 `quote_name_unless_alias` in `django.db.models.sql.compiler` because it
 uses DatabaseOperations' `quote_name` function. Could changing the
 DatabaseOperations for `django.db.backends.dummy` to have a `quote_name`
 function like that of sqlite?

 I'm thinking of something like:
 {{{
 def quote_name(self, name):
         if name.startswith('"') and name.endswith('"'):
             return name  # Quoting once is enough.
         return '"%s"' % name
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25947#comment:2>
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/063.cb35ae9c780f457767e4cd8590b53e88%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to