              th_classes.append('sorted %sending' % order_type)
              new_order_type = {'asc': 'desc', 'desc': 'asc'}[order_type]
  
          # build new ordering param
          o_list = []
          make_qs_param = lambda t, n: ('-' if t == 'desc' else '') + str(n)
  
          for j, ot in ordering_field_columns.items():
              if j == i: # Same column
                  # We want clicking on this header to bring the ordering to the
 
</s> remove                 o_list.insert(0, make_qs_param(new_order_type, j))
 </s> add                 o_list_primary.insert(0, param)
                o_list_toggle.append(param)
                # o_list_remove - omit </s> remove             "url": cl.get_query_string({ORDER_VAR: o_list}),
 </s> add             "url_primary": cl.get_query_string({ORDER_VAR: '.'.join(o_list_primary)}),
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}), </s> remove         o_list = '.'.join(o_list)
 </s> add  </s> remove                 o_list.append(make_qs_param(ot, j))
 </s> add                 param = make_qs_param(ot, j)
                o_list_primary.append(param)
                o_list_toggle.append(param)
                o_list_remove.append(param)
        o_list_primary = [] # URL for making this field the primary sort
        o_list_remove  = [] # URL for removing this field from sort
        o_list_toggle  = [] # URL for toggling order type for this field
              th_classes.append('sorted %sending' % order_type)
              new_order_type = {'asc': 'desc', 'desc': 'asc'}[order_type]
  
          # build new ordering param
        o_list_primary = [] # URL for making this field the primary sort
        o_list_remove  = [] # URL for removing this field from sort
        o_list_toggle  = [] # URL for toggling order type for this field
          make_qs_param = lambda t, n: ('-' if t == 'desc' else '') + str(n)
  
          for j, ot in ordering_field_columns.items():
              if j == i: # Same column
                  # We want clicking on this header to bring the ordering to the
keep keep keep keep replace keep keep keep keep keep
 Improved UI for advanced sorting controls.

Now allows individual fields to be removed/toggled.

Refs #11868

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16320 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/admin/templatetags/admin_list.py