#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):

 David, I don't think that an additional feature flag is needed. You can
 always define `as_mssql()` to override the current behavior on MSSQL. If
 MSSQL doesn't support `nulls_first` and `nulls_last` I would raise an
 exception, e.g.
 {{{
 def as_mssql(self, compiler, connection):
     if self.nulls_first or self.nulls_last:
         raise NotSupportedError('nulls_first/nulls_last are not supported
 on MSSQL.')
     return self.as_sql(compiler, connection, template=template)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32584#comment:5>
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.783df3057c063e05b6889f6915dc086c%40djangoproject.com.

Reply via email to