Skip to content

Commit

Permalink
Merge branch 'release/0.15.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
xrotwang committed Aug 1, 2014
2 parents 2911749 + 0bd8c02 commit 09e4783
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Expand Up @@ -2,6 +2,12 @@
Changes
-------

0.15.5
~~~~~~

- better support in DataTable for resources which are not db models.


0.15.4
~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion clld/__init__.py
Expand Up @@ -5,7 +5,7 @@
from clld import interfaces


__version__ = "0.15.4"
__version__ = "0.15.5"
_Resource = namedtuple('Resource', 'name model interface with_index with_rdfdump')


Expand Down
7 changes: 5 additions & 2 deletions clld/web/datatables/base.py
Expand Up @@ -353,6 +353,9 @@ def get_default_options(self):
'%ss' % self.model.mapper_name().lower(), _query=query_params),
}

def db_model(self):
return self.model

def base_query(self, query):
"""Custom DataTables can overwrite this method to add joins, or apply filters.
Expand All @@ -361,11 +364,11 @@ def base_query(self, query):
return query

def default_order(self):
return self.model.pk
return self.db_model().pk

def get_query(self, limit=1000, offset=0):
query = self.base_query(
DBSession.query(self.model).filter(self.model.active == True))
DBSession.query(self.db_model()).filter(self.db_model().active == True))
self.count_all = query.count()

_filters = []
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -51,10 +51,10 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = '0.15.4'
release = '0.15.5'

# The short X.Y version.
version = '0.15.4'
version = '0.15.5'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -80,7 +80,7 @@
]

setup(name='clld',
version='0.15.4',
version='0.15.5',
description=(
'Python library supporting the development of cross-linguistic databases'),
long_description='',
Expand Down

0 comments on commit 09e4783

Please sign in to comment.