as_sql(compiler, connection, function=None, template=None, arg_joiner=None, **extra_context)
[source]
Generates the SQL for the database function.
The as_vendor()
methods should use the function
, template
, arg_joiner
, and any other **extra_context
parameters to customize the SQL as needed. For example:
1 2 3 4 5 6 7 8 9 10 11 | class ConcatPair(Func): ... function = 'CONCAT' ... def as_mysql( self , compiler, connection): return super (ConcatPair, self ).as_sql( compiler, connection, function = 'CONCAT_WS' , template = "%(function)s('', %(expressions)s)" , ) |
Changed in Django 1.10:
Support for the arg_joiner
and **extra_context
parameters was added.
Please login to continue.