Skip to content

Commit

Permalink
Added simple Alias forcing for a single table zacharyvoase#4
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Walton committed May 9, 2013
1 parent 1108899 commit 0d34754
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions django_postgres/db/sql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ def quote_name_unless_alias(self, name):

self.quote_cache[name] = name
return name

def as_sql(self, *args, **kwargs):
"""Messy hack to create some table aliases for us.
"""
self.query.table_map[self.query.model._meta.db_table] = ['']
return super(NonQuotingCompiler, self).as_sql(*args, **kwargs)

0 comments on commit 0d34754

Please sign in to comment.