title: How to sort by within a Django list
body: <p>This is a list of jobs and their prices.
  I need help on the sorting. I want to make it so that when you click on sort by Budget, the list is ordered by budget decreasing, and when clicked again change to sort by budget increasing. I don't know if this requires a new page site/findjob/sortbybudget, but I prefer to do this within site/findjob. I would appreciate any help or references I can read up to do this.</p>
  
  <p><strong>This is urls.py</strong></p>
  
  <pre><code>from django.conf.urls.defaults import patterns, include, url
  
  from project.preview.models import Task
  
  info_task = {
      'queryset': Task.objects.all(),
      'template_name': 'template.html',
  }
  
  urlpatterns = patterns('',
      (r'^findtask/$', 'django.views.generic.list_detail.object_list', dict(info_task)),
  )
  </code></pre>
  
  <p><strong>This is: template.html</strong></p>
  
  <pre><code>&lt;div class="sortList"&gt;
  **Sort by:**
  &lt;ul&gt;
      &lt;li class="sort"&gt;&lt;a href=""/&gt;Budget&lt;/a&gt;&lt;/li&gt;
      &lt;li class="sort"&gt;&lt;a href=""/&gt;Newly Added&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="taskListCon"&gt;
          {% for object in object_list %}
          &lt;div class="taskCon"&gt;
            &lt;div class="Title"&gt;
            {{ object.title_description }}
            &lt;/div&gt;
            &lt;div class="clientID"&gt;                    
            {{object.userid}}
            &lt;/div&gt;
            &lt;div class="Price"&gt;
            Budget:{{ object.max_budget }}
          &lt;/div&gt;
  &lt;div&gt;
  {% endfor %}
  </code></pre>