Skip to content

Commit

Permalink
Merge pull request #167 from bbajuzik/160-django-4.2-compatibility
Browse files Browse the repository at this point in the history
Django 4.2+ compatible setup_query
  • Loading branch information
palewire committed Jun 15, 2023
2 parents 66aaac0 + c953a5d commit 39d4d4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postgres_copy/copy_to.py
Expand Up @@ -17,11 +17,11 @@ class SQLCopyToCompiler(SQLCompiler):
"""
Custom SQL compiler for creating a COPY TO query (postgres backend only).
"""
def setup_query(self):
def setup_query(self, **kwargs):
"""
Extend the default SQLCompiler.setup_query to add re-ordering of items in select.
"""
super(SQLCopyToCompiler, self).setup_query()
super(SQLCopyToCompiler, self).setup_query(**kwargs)
if self.query.copy_to_fields:
self.select = []
for field in self.query.copy_to_fields:
Expand Down

0 comments on commit 39d4d4c

Please sign in to comment.