Skip to content

Commit

Permalink
Fix bug with sorting of virtual columns
Browse files Browse the repository at this point in the history
Certain non-local fields would raise errors when checked for sorting instructions.
  • Loading branch information
tiliv committed Dec 20, 2013
1 parent 14b64bf commit df13bcc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datatableview/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
__name__ = 'datatableview'
__author__ = 'Tim Valenta'
__version_info__ = (0, 6, 2)
__version_info__ = (0, 6, 3)
__version__ = '.'.join(map(str, __version_info__))
__date__ = '2013/11/14 2:00:00 PM'
__credits__ = ['Tim Valenta', 'Steven Klass']
Expand Down
5 changes: 4 additions & 1 deletion datatableview/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ def _normalize_options(self, query, options):

column = options['columns'][column_index]
column = get_field_definition(column)
is_local_field = column.fields[0] in self._model._meta.get_all_field_names()
if column.fields and column.fields[0] in self._model._meta.get_all_field_names():
is_local_field = True
else:
is_local_field = False
if not column.fields or len(column.fields) > 1 or not is_local_field:
field_name = '!{0}'.format(column_index)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages

setup(name='django-datatable-view',
version='0.6.2',
version='0.6.3',
description='This package is used in conjunction with the jQuery plugin '
'(http://http://datatables.net/), and supports state-saving detection'
' with (http://datatables.net/plug-ins/api). The package consists of '
Expand Down

0 comments on commit df13bcc

Please sign in to comment.