Skip to content

Commit

Permalink
fixed detection of multi-table inheritance in combination with only()…
Browse files Browse the repository at this point in the history
…/deferred()
  • Loading branch information
Waldemar Kornewald committed Feb 13, 2011
1 parent e58d0b2 commit 518773f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions djangotoolbox/db/basecompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ def get_fields(self):
only_load = self.deferred_to_columns()
if only_load:
db_table = self.query.model._meta.db_table
only_load = dict((k, v) for k, v in only_load.items()
if v or k == db_table)
if len(only_load.keys()) > 1:
raise DatabaseError('Multi-table inheritance is not supported '
'by non-relational DBs.' + repr(only_load))
fields = [f for f in fields if db_table in only_load and
f.column in only_load[db_table]]

Expand Down

0 comments on commit 518773f

Please sign in to comment.