Module ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListComp TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad ListLoad TupleLoad AttributeLoad NameLoad attr Str Str TupleLoad AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr ListComp TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad ListLoad TupleLoad AttributeLoad NameLoad attr Str Str TupleLoad AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str attr keyword Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad keyword NameLoad keyword Num Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str attr keyword Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str Str attr keyword Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str Str attr keyword Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad attr Str With Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad ListLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr CompareIn Str Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr Str With Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad ListLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr CompareIn Str Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr With Call AttributeLoad NameLoad attr Num body Expr AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A __future__ absolute_import unicode_literals django.test TestCase django.utils six models Building Child Device Port Item Country Connection ClientStatus State Client SpecialClient TUser Person Student Organizer Class Enrollment Hen Chick SelectRelatedRegressTests N/A TestCase N/A test_regression_7110 N/A N/A self N/A N/A N/A 
        Regression test for bug #7110.

        When using select_related(), we must query the
        Device and Building tables using two different aliases (each) in order to
        differentiate the start and end Connection fields. The net result is that
        both the "connections = ..." queries here should give the same results
        without pulling in more than the absolute minimum number of tables
        (history has shown that it's easy to make a mistake in the implementation
        and include some unnecessary bonus joins).
         N/A b N/A N/A N/A Building objects create name 101 N/A dev1 N/A N/A N/A Device objects create name router building b N/A dev2 N/A N/A N/A Device objects create name switch building b N/A dev3 N/A N/A N/A Device objects create name server building b N/A port1 N/A N/A N/A Port objects create port_number 4 device dev1 N/A port2 N/A N/A N/A Port objects create port_number 7 device dev2 N/A port3 N/A N/A N/A Port objects create port_number 1 device dev3 N/A c1 N/A N/A N/A Connection objects create start port1 end port2 N/A c2 N/A N/A N/A Connection objects create start port2 end port3 N/A connections N/A N/A N/A N/A N/A Connection objects filter start__device__building b end__device__building b order_by id N/A N/A N/A self assertEqual N/A N/A N/A c id N/A N/A six text_type N/A c start N/A N/A six text_type N/A c end N/A c connections N/A N/A N/A c1 id router/4 switch/7 N/A N/A c2 id switch/7 server/1 N/A connections N/A N/A N/A N/A N/A N/A N/A Connection objects filter start__device__building b end__device__building b select_related order_by id N/A N/A N/A self assertEqual N/A N/A N/A c id N/A N/A six text_type N/A c start N/A N/A six text_type N/A c end N/A c connections N/A N/A N/A c1 id router/4 switch/7 N/A N/A c2 id switch/7 server/1 N/A N/A N/A self assertEqual N/A N/A N/A str N/A connections query count  JOIN  6 N/A test_regression_8106 N/A N/A self N/A N/A N/A 
        Regression test for bug #8106.

        Same sort of problem as the previous test, but this time there are
        more extra tables to pull in as part of the select_related() and some
        of them could potentially clash (so need to be kept separate).
         N/A us N/A N/A N/A TUser objects create name std N/A usp N/A N/A N/A Person objects create user us N/A uo N/A N/A N/A TUser objects create name org N/A uop N/A N/A N/A Person objects create user uo N/A s N/A N/A N/A Student objects create person usp N/A o N/A N/A N/A Organizer objects create person uop N/A c N/A N/A N/A Class objects create org o N/A e N/A N/A N/A Enrollment objects create std s cls c N/A e_related N/A N/A N/A N/A N/A N/A Enrollment objects all select_related N/A 0 N/A N/A N/A self assertEqual N/A N/A N/A N/A e_related std person user name std N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A e_related cls org person user name org N/A test_regression_8036 N/A N/A self N/A N/A N/A 
        Regression test for bug #8036

        the first related model in the tests below
        ("state") is empty and we try to select the more remotely related
        state__country. The regression here was not skipping the empty column results
        for country before getting status.
         N/A australia N/A N/A N/A Country objects create name Australia N/A active N/A N/A N/A ClientStatus objects create name active N/A client N/A N/A N/A Client objects create name client status active N/A N/A N/A self assertEqual N/A client status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related N/A 0 status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related state N/A 0 status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related state status N/A 0 status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related state__country N/A 0 status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related state__country status N/A 0 status active N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A Client objects select_related status N/A 0 status active N/A test_multi_table_inheritance N/A N/A self N/A N/A N/A  Exercising select_related() with multi-table model inheritance.  N/A c1 N/A N/A N/A Child objects create name child1 value 42 N/A i1 N/A N/A N/A Item objects create name item1 child c1 N/A i2 N/A N/A N/A Item objects create name item2 N/A N/A N/A self assertQuerysetEqual N/A N/A N/A N/A N/A Item objects select_related child order_by name N/A <Item: item1> <Item: item2> N/A test_regression_12851 N/A N/A self N/A N/A N/A 
        Regression for #12851

        Deferred fields are used correctly if you select_related a subset
        of fields.
         N/A australia N/A N/A N/A Country objects create name Australia N/A active N/A N/A N/A ClientStatus objects create name active N/A wa N/A N/A N/A State objects create name Western Australia country australia N/A c1 N/A N/A N/A Client objects create name Brian Burke state wa status active N/A burke N/A N/A N/A N/A N/A N/A N/A Client objects select_related state defer state__name get name Brian Burke N/A N/A N/A self assertEqual N/A burke name Brian Burke N/A N/A N/A self assertEqual N/A N/A burke state name Western Australia N/A sc1 N/A N/A N/A SpecialClient objects create name Troy Buswell state wa status active value 42 N/A troy N/A N/A N/A N/A N/A N/A N/A SpecialClient objects select_related state defer state__name get name Troy Buswell N/A N/A N/A self assertEqual N/A troy name Troy Buswell N/A N/A N/A self assertEqual N/A troy value 42 N/A N/A N/A self assertEqual N/A N/A troy state name Western Australia N/A troy N/A N/A N/A N/A N/A N/A N/A SpecialClient objects select_related state defer value state__name get name Troy Buswell N/A N/A N/A self assertEqual N/A troy name Troy Buswell N/A N/A N/A self assertEqual N/A troy value 42 N/A N/A N/A self assertEqual N/A N/A troy state name Western Australia N/A troy N/A N/A N/A N/A N/A N/A N/A SpecialClient objects select_related state only name state get name Troy Buswell N/A N/A N/A self assertEqual N/A troy name Troy Buswell N/A N/A N/A self assertEqual N/A troy value 42 N/A N/A N/A self assertEqual N/A N/A troy state name Western Australia N/A test_null_join_promotion N/A N/A self N/A N/A N/A australia N/A N/A N/A Country objects create name Australia N/A active N/A N/A N/A ClientStatus objects create name active N/A wa N/A N/A N/A State objects create name Western Australia country australia N/A bob N/A N/A N/A Client objects create name Bob status active N/A jack N/A N/A N/A Client objects create name Jack status active state wa N/A qs N/A N/A N/A N/A N/A Client objects filter state wa select_related state N/A N/A N/A self assertNumQueries 1 N/A N/A N/A N/A self assertEqual N/A list qs N/A jack N/A N/A N/A self assertEqual N/A N/A qs N/A 0 state wa N/A N/A N/A self assertFalse N/A LEFT OUTER N/A str N/A qs query N/A qs N/A N/A N/A N/A N/A Client objects select_related state order_by name N/A N/A N/A self assertNumQueries 1 N/A N/A N/A N/A self assertEqual N/A list qs N/A bob jack N/A N/A N/A self assertIs N/A N/A qs N/A 0 state None N/A N/A N/A self assertEqual N/A N/A qs N/A 1 state wa N/A N/A N/A self assertTrue N/A LEFT OUTER N/A str N/A qs query N/A test_regression_19870 N/A N/A self N/A N/A N/A 
        Regression for #19870

         N/A hen N/A N/A N/A Hen objects create name Hen N/A chick N/A N/A N/A Chick objects create name Chick mother hen N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A N/A Chick objects all N/A 0 mother name Hen N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A N/A Chick objects select_related N/A 0 mother name Hen N/A test_regression_22508 N/A N/A self N/A N/A N/A building N/A N/A N/A Building objects create name 101 N/A device N/A N/A N/A Device objects create name router building building N/A N/A N/A N/A Port objects create port_number 1 device device N/A device N/A N/A N/A Device objects get N/A port N/A N/A N/A N/A N/A device port_set select_related device__building get N/A N/A N/A self assertNumQueries 0 N/A N/A N/A N/A port device building N/A N/A