title: custom sorting for table in django-tables2
body: <p>I have a table with django-tables2 on one site with django-filter as well. I am using <code>PagedFilteredTableView</code> that looks like this:</p>
  
  <pre><code>class PagedFilteredTableView(SingleTableView):
      filter_class = None
      formhelper_class = None
      context_filter_name = 'filter'
  
      def get_queryset(self, **kwargs):
          qs = super(PagedFilteredTableView, self).get_queryset()
          self.filter = self.filter_class(self.request.GET, queryset=qs)
          self.filter.form.helper = self.formhelper_class()
          return self.filter.qs
  
      def get_context_data(self, **kwargs):
          context = super(PagedFilteredTableView, self).get_context_data()
          context[self.context_filter_name] = self.filter
          return context
  </code></pre>
  
  <p>This is view:</p>
  
  <pre><code>def sorted_str_number(str):
      return int(str)
  
  
  class PageList(PagedFilteredTableView):
  
      model = Page
      table_class = PageTable
      filter_class = PageListFilter
      formhelper_class = PageListFormHelper
  
      pagination = {
          '20': 20,
          '50': 50,
          '100': 100,
      }
  
      def get_table_class(self):
          klass = super().get_table_class()
          if 'pagination' in self.request.GET:
              klass._meta.per_page = int(self.request.GET['pagination'])
          return klass
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          context['per_page_table'] = sorted(self.pagination.keys(), key=sorted_str_number)
          return context
  </code></pre>
  
  <p>I need to implement <a href="https://stackoverflow.com/questions/19366517/sorting-in-python-how-to-sort-a-list-containing-alphanumeric-values">natural sort</a> for one column.  I thought I could override <a href="https://django-tables2.readthedocs.io/en/latest/pages/ordering.html#table-order-foo-methods" rel="nofollow">order</a> behaviour in <code>tables.py</code> like this:</p>
  
  <pre><code>class PageTable(Table):
      column_name = Column(verbose_name='ID')
  
      def order_column_name(self, queryset, is_descending):  
          return sorted(queryset, key=lambda q: natural_sort_key(q.column_name)), True
  </code></pre>
  
  <p>But order_column_name method is ignored. Where should I override custom sorting for one field when using <code>django-tables2</code> and <code>django-filter</code>?</p>