chore: Update django api
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2709>
This commit is contained in:
parent
f1f6ef43ad
commit
803b077f00
|
@ -60,12 +60,12 @@ class NullsLastSQLCompiler(SQLCompiler):
|
||||||
class NullsLastQuery(models.sql.query.Query):
|
class NullsLastQuery(models.sql.query.Query):
|
||||||
"""Use a custom compiler to inject 'NULLS LAST' (for PostgreSQL)."""
|
"""Use a custom compiler to inject 'NULLS LAST' (for PostgreSQL)."""
|
||||||
|
|
||||||
def get_compiler(self, using=None, connection=None):
|
def get_compiler(self, using=None, connection=None, elide_empty=True):
|
||||||
if using is None and connection is None:
|
if using is None and connection is None:
|
||||||
raise ValueError("Need either using or connection")
|
raise ValueError("Need either using or connection")
|
||||||
if using:
|
if using:
|
||||||
connection = connections[using]
|
connection = connections[using]
|
||||||
return NullsLastSQLCompiler(self, connection, using)
|
return NullsLastSQLCompiler(self, connection, using, elide_empty)
|
||||||
|
|
||||||
|
|
||||||
class NullsLastQuerySet(models.QuerySet):
|
class NullsLastQuerySet(models.QuerySet):
|
||||||
|
|
Loading…
Reference in New Issue