diff options
| author | priyanshsaxena <askpriyansh@gmail.com> | 2018-02-08 12:39:00 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-08-23 11:52:09 -0400 |
| commit | 83b04d4f88dd65ae630a45385de34e275899dc41 (patch) | |
| tree | 50b1ec204e8ee30da63d9f2dcc8208e282c3b723 /docs | |
| parent | 08f360355a0f47b35df355aae6ba88957b0e3a8d (diff) | |
Fixed #29048 -- Added **extra_context to database function as_vendor() methods.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/custom-lookups.txt | 2 | ||||
| -rw-r--r-- | docs/ref/models/expressions.txt | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/howto/custom-lookups.txt b/docs/howto/custom-lookups.txt index 55fdc42237..1e73d329e7 100644 --- a/docs/howto/custom-lookups.txt +++ b/docs/howto/custom-lookups.txt @@ -275,7 +275,7 @@ We can change the behavior on a specific backend by creating a subclass of ``NotEqual`` with an ``as_mysql`` method:: class MySQLNotEqual(NotEqual): - def as_mysql(self, compiler, connection): + def as_mysql(self, compiler, connection, **extra_context): lhs, lhs_params = self.process_lhs(compiler, connection) rhs, rhs_params = self.process_rhs(compiler, connection) params = lhs_params + rhs_params diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 5969085ee4..281b3144ae 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -322,11 +322,12 @@ The ``Func`` API is as follows: function = 'CONCAT' ... - def as_mysql(self, compiler, connection): + def as_mysql(self, compiler, connection, **extra_context): return super().as_sql( compiler, connection, function='CONCAT_WS', template="%(function)s('', %(expressions)s)", + **extra_context ) To avoid a SQL injection vulnerability, ``extra_context`` :ref:`must |
