Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias alias alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list decorator_list Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Call NameLoad keyword Str keyword Str keyword Num Call NameLoad keyword Str keyword Str keyword Num Call NameLoad keyword Str keyword Str keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body Assign NameStore TupleLoad Str decorator_list Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Call NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword Num Call NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword Num Call NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str keyword Num ClassDef bases AttributeLoad NameLoad attr body Pass decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body ClassDef bases AttributeLoad NameLoad attr body Pass decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body ClassDef bases AttributeLoad NameLoad attr body Assign NameStore TupleLoad Str decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body If CompareEq AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body If CompareEq AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore TupleLoad Str decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr decorator_list decorator_list
N/A __future__ unicode_literals django.contrib admin django.contrib.admin.options ModelAdmin django.contrib.auth.models User django.test RequestFactory TestCase models Band DynOrderingBandAdmin Song SongInlineDefaultOrdering SongInlineNewOrdering MockRequest N/A object N/A N/A N/A MockSuperUser N/A object N/A has_perm N/A N/A self perm N/A N/A N/A True N/A has_module_perms N/A N/A self module N/A N/A N/A True N/A N/A N/A request N/A MockRequest N/A N/A request user N/A MockSuperUser N/A site N/A N/A admin AdminSite TestAdminOrdering N/A TestCase N/A N/A 
    Let's make sure that ModelAdmin.get_queryset uses the ordering we define
    in ModelAdmin rather that ordering defined in the model's inner Meta
    class.
     setUp N/A N/A self N/A N/A N/A N/A self request_factory N/A RequestFactory N/A N/A N/A N/A Band objects bulk_create N/A N/A Band name Aerosmith bio rank 3 N/A Band name Radiohead bio rank 1 N/A Band name Van Halen bio rank 2 N/A test_default_ordering N/A N/A self N/A N/A N/A 
        The default ordering should be by name, as specified in the inner Meta
        class.
         N/A ma N/A ModelAdmin Band site N/A names N/A N/A b name N/A b N/A N/A ma get_queryset request N/A N/A N/A self assertListEqual N/A Aerosmith Radiohead Van Halen names N/A test_specified_ordering N/A N/A self N/A N/A N/A 
        Let's use a custom ModelAdmin that changes the ordering, and make sure
        it actually changes.
         BandAdmin N/A ModelAdmin N/A N/A ordering N/A rank N/A N/A ma N/A BandAdmin Band site N/A names N/A N/A b name N/A b N/A N/A ma get_queryset request N/A N/A N/A self assertListEqual N/A Radiohead Van Halen Aerosmith names N/A test_dynamic_ordering N/A N/A self N/A N/A N/A 
        Let's use a custom ModelAdmin that changes the ordering dynamically.
         N/A super_user N/A N/A N/A User objects create username admin is_superuser True N/A other_user N/A N/A N/A User objects create username other N/A request N/A N/A N/A self request_factory get / N/A N/A request user super_user N/A ma N/A DynOrderingBandAdmin Band site N/A names N/A N/A b name N/A b N/A N/A ma get_queryset request N/A N/A N/A self assertListEqual N/A Radiohead Van Halen Aerosmith names N/A N/A request user other_user N/A names N/A N/A b name N/A b N/A N/A ma get_queryset request N/A N/A N/A self assertListEqual N/A Aerosmith Radiohead Van Halen names N/A N/A TestInlineModelAdminOrdering N/A TestCase N/A N/A 
    Let's make sure that InlineModelAdmin.get_queryset uses the ordering we
    define in InlineModelAdmin.
     setUp N/A N/A self N/A N/A N/A N/A self band N/A N/A N/A Band objects create name Aerosmith bio rank 3 N/A N/A N/A N/A Song objects bulk_create N/A N/A Song band N/A self band name Pink duration 235 N/A Song band N/A self band name Dude (Looks Like a Lady) duration 264 N/A Song band N/A self band name Jaded duration 214 N/A test_default_ordering N/A N/A self N/A N/A N/A 
        The default ordering should be by name, as specified in the inner Meta
        class.
         N/A inline N/A SongInlineDefaultOrdering N/A self band site N/A names N/A N/A s name N/A s N/A N/A inline get_queryset request N/A N/A N/A self assertListEqual N/A Dude (Looks Like a Lady) Jaded Pink names N/A test_specified_ordering N/A N/A self N/A N/A N/A 
        Let's check with ordering set to something different than the default.
         N/A inline N/A SongInlineNewOrdering N/A self band site N/A names N/A N/A s name N/A s N/A N/A inline get_queryset request N/A N/A N/A self assertListEqual N/A Jaded Pink Dude (Looks Like a Lady) names N/A N/A TestRelatedFieldsAdminOrdering N/A TestCase N/A setUp N/A N/A self N/A N/A N/A N/A self b1 N/A N/A N/A Band objects create name Pink Floyd bio rank 1 N/A N/A self b2 N/A N/A N/A Band objects create name Foo Fighters bio rank 5 SongAdmin N/A N/A admin ModelAdmin N/A N/A N/A N/A N/A N/A site register Song SongAdmin N/A tearDown N/A N/A self N/A N/A N/A N/A N/A site unregister Song N/A N/A Band N/A site _registry N/A N/A N/A N/A site unregister Band N/A check_ordering_of_field_choices N/A N/A self correct_ordering N/A N/A N/A fk_field N/A N/A N/A N/A site _registry N/A Song formfield_for_foreignkey N/A N/A Song band field request None N/A m2m_field N/A N/A N/A N/A site _registry N/A Song formfield_for_manytomany N/A N/A Song other_interpreters field request None N/A N/A N/A self assertListEqual N/A list N/A fk_field queryset correct_ordering N/A N/A N/A self assertListEqual N/A list N/A m2m_field queryset correct_ordering N/A test_no_admin_fallback_to_model_ordering N/A N/A self N/A N/A N/A N/A N/A self check_ordering_of_field_choices N/A N/A self b2 N/A self b1 N/A test_admin_with_no_ordering_fallback_to_model_ordering N/A N/A self N/A N/A NoOrderingBandAdmin N/A N/A admin ModelAdmin N/A N/A N/A N/A N/A N/A site register Band NoOrderingBandAdmin N/A N/A N/A self check_ordering_of_field_choices N/A N/A self b2 N/A self b1 N/A test_admin_ordering_beats_model_ordering N/A N/A self N/A N/A StaticOrderingBandAdmin N/A N/A admin ModelAdmin N/A N/A ordering N/A rank N/A N/A N/A N/A site register Band StaticOrderingBandAdmin N/A N/A N/A self check_ordering_of_field_choices N/A N/A self b1 N/A self b2 N/A test_custom_queryset_still_wins N/A N/A self N/A N/A N/A Test that custom queryset has still precedence (#21405) SongAdmin N/A N/A admin ModelAdmin N/A formfield_for_foreignkey N/A N/A self db_field request N/A kwargs N/A N/A N/A N/A db_field name band N/A N/A N/A kwargs N/A queryset N/A N/A N/A Band objects filter rank__gt 2 N/A N/A N/A N/A super SongAdmin self formfield_for_foreignkey db_field request kwargs N/A formfield_for_manytomany N/A N/A self db_field request N/A kwargs N/A N/A N/A N/A db_field name other_interpreters N/A N/A N/A kwargs N/A queryset N/A N/A N/A Band objects filter rank__gt 2 N/A N/A N/A N/A super SongAdmin self formfield_for_foreignkey db_field request kwargs N/A N/A StaticOrderingBandAdmin N/A N/A admin ModelAdmin N/A N/A ordering N/A rank N/A N/A N/A N/A site unregister Song N/A N/A N/A site register Song SongAdmin N/A N/A N/A site register Band StaticOrderingBandAdmin N/A N/A N/A self check_ordering_of_field_choices N/A N/A self b2 N/A N/A