Commits

Waldemar Kornewald committed ec28121

fixed detection of multi-table inheritance in combination with only()/deferred()

Comments (0)

Files changed (1)

djangotoolbox/db/basecompiler.py

         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]]