mirror of https://github.com/sgoudham/Enso-Bot.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
704 B
Python
26 lines
704 B
Python
5 years ago
|
from django.db.models.sql import compiler
|
||
|
|
||
|
|
||
|
class SQLCompiler(compiler.SQLCompiler):
|
||
|
def as_subquery_condition(self, alias, columns, compiler):
|
||
|
qn = compiler.quote_name_unless_alias
|
||
|
qn2 = self.connection.ops.quote_name
|
||
|
sql, params = self.as_sql()
|
||
|
return '(%s) IN (%s)' % (', '.join('%s.%s' % (qn(alias), qn2(column)) for column in columns), sql), params
|
||
|
|
||
|
|
||
|
class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):
|
||
|
pass
|