#32584: OrderBy.as_sql() overwrites template, creating invalid syntax for 
certain
database backends
-------------------------------------+-------------------------------------
     Reporter:  Tim Nyborg           |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  order_by,            |             Triage Stage:
  nulls_first                        |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

 You can also disable `nulls_first` and `nulls_last` if you handled them in
 your custom template, e.g.
 {{{
 def as_mssql(self, compiler, connection):
     template = ...
     copy = self.copy()
     copy.nulls_first = False
     copy.nulls_last = False
     return copy.as_sql(compiler, connection, template=template)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32584#comment:6>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e83c47d4737e97878d4e875f09c9f99f%40djangoproject.com.

Reply via email to