title: How to list the given data in ascending order. The columns "Account name " and " Account status"
body: <p><a href="https://i.stack.imgur.com/pQWsh.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>views.py</p>
  <pre class="lang-py prettyprint-override"><code>def listEngagements(request):
  
      active=Engagement.objects.filter(status=&quot;Active&quot;)
  
      completed=Engagement.objects.filter(status=&quot;Completed&quot;)
  
      datas_list=active|completed
  
      query = request.GET.get('q')
  
      if query:
  
          datas_list = Engagement.objects.filter(engagementName__contains=query)
  
      paginator = Paginator(datas_list, 20) # 6 datas per page
  
      page = request.GET.get('page',1)
  
      try:
  
          datas = paginator.page(page)
  
      except PageNotAnInteger:
  
          datas = paginator.page(1)
  
      except EmptyPage:
  
          datas = paginator.page(paginator.num_pages)
  
      return render(request,'engagement.html',{'datas':datas,'username':username})
  </code></pre>
  <p>models</p>
  <pre class="lang-py prettyprint-override"><code>class Engagement(models.Model):
      engagementName = models.CharField(default=&quot; &quot;,max_length=100,null=True,blank=True)
      engagementValue=models.IntegerField(default=0)
      email = models.EmailField(null=True,blank=True)
      status = models.CharField(max_length=50,null=True)
   
      class Meta:
          ordering =['engagementName']
      def __str__(self):
          return str(self.engagementName)
  </code></pre>
  <p>html code</p>
  <pre class="lang-html prettyprint-override"><code>     &lt;table class=&quot;table table-stripped table-hover&quot;&gt;
                                          &lt;thead&gt;
                                              &lt;tr&gt;
                                                  &lt;th&gt;Account Name&lt;/th&gt;
                                                  &lt;th&gt;Account Value&lt;/th&gt;
                                                  &lt;th&gt;Email&lt;/th&gt;
                                                  &lt;th&gt;Account Status&lt;/th&gt;
                                                  &lt;th&gt;&lt;/th&gt;
                                              &lt;/tr&gt;
                                          &lt;/thead&gt;
                                          &lt;tbody&gt;
                                             {% for i in datas %}
                                              &lt;tr&gt;
                                                  &lt;td&gt;{{i.engagementName}}&lt;/td&gt;
                                                  &lt;td&gt;{{i.engagementValue}}&lt;/td&gt; 
                                                  &lt;td&gt;{{i.email}}&lt;/td&gt;
                                                  &lt;td&gt;{{i.status}}&lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;a href=&quot;#editEmployeeModal&quot; class=&quot;edit&quot; data-toggle=&quot;modal&quot; 
                                                      onclick=&quot;editengagementDetails(
                                                         name = '{{i.engagementName}}',
                                                        
                                                           
                                                          engagement_id = '{{ i.id }}',
                                                          email = '{{i.email}}',
                                                          status ='{{i.status}}'
                                                          );&quot; &gt;&lt;i
                                                              class=&quot;fa fa-edit&quot; data-toggle=&quot;tooltip&quot; title=&quot;Edit&quot;&gt;&lt;/i&gt;&lt;/a&gt;
                                                      &lt;!-- &lt;a href=&quot;{% url 'deleteclient' i.id %}&quot; class=&quot;delete&quot; &gt;&lt;i
                                                          class=&quot;fa fa-trash&quot; data-toggle=&quot;tooltip&quot; title=&quot;Delete&quot;&gt;&lt;/i&gt;&lt;/a&gt; --&gt;
                                                  &lt;/td&gt;
                                              &lt;/tr&gt;
                                      
                                              {% endfor %}
                                          &lt;/tbody&gt;
  
  </code></pre>