Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Fixes default ordering of apps and slight refactor on translating sor…
Browse files Browse the repository at this point in the history
…t cols
  • Loading branch information
kumar303 committed Aug 25, 2011
1 parent 4cf07da commit f32d4b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/editors/helpers.py
Expand Up @@ -206,7 +206,7 @@ def render_waiting_time_min(self, row):
return jinja2.escape(r)

@classmethod
def translate_legacy_cols(cls, colname):
def translate_sort_cols(cls, colname):
legacy_sorts = {
'name': 'addon_name',
'age': 'waiting_time_min',
Expand Down Expand Up @@ -261,12 +261,12 @@ def render_created(self, row):
return timesince(row.created)

@classmethod
def translate_legacy_cols(cls, colname):
def translate_sort_cols(cls, colname):
return colname

@classmethod
def default_order_by(cls):
return '-created'
return 'created'

@classmethod
def get_addon_slug(cls, row):
Expand Down
2 changes: 1 addition & 1 deletion apps/editors/views.py
Expand Up @@ -268,7 +268,7 @@ def _queue(request, TableObj, tab, qs=None):
except IndexError:
pass
order_by = request.GET.get('sort', TableObj.default_order_by())
order_by = TableObj.translate_legacy_cols(order_by)
order_by = TableObj.translate_sort_cols(order_by)
table = TableObj(data=qs, order_by=order_by)
default = 100
per_page = request.GET.get('per_page', default)
Expand Down

0 comments on commit f32d4b7

Please sign in to comment.