diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py index ca1cb961c0..1b98f89b70 100644 --- a/django/db/backends/postgresql_psycopg2/introspection.py +++ b/django/db/backends/postgresql_psycopg2/introspection.py @@ -39,7 +39,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): WHERE c.relkind IN ('r', 'v') AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND pg_catalog.pg_table_is_visible(c.oid)""") - return [TableInfo(row[0], {'r':'t', 'v': 'v'}.get(row[1])) + return [TableInfo(row[0], {'r': 't', 'v': 'v'}.get(row[1])) for row in cursor.fetchall() if row[0] not in self.ignored_tables] diff --git a/tests/one_to_one/models.py b/tests/one_to_one/models.py index 3c204e5c92..8a5defe856 100644 --- a/tests/one_to_one/models.py +++ b/tests/one_to_one/models.py @@ -113,6 +113,7 @@ class DirectorManager(models.Manager): def get_queryset(self): return super(DirectorManager, self).get_queryset().filter(is_temp=False) + class Director(models.Model): is_temp = models.BooleanField(default=False) school = models.OneToOneField(School)