Skip to content

Commit

Permalink
Merge branch 'release/3.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
xrotwang committed Mar 21, 2017
2 parents d313eaf + 30b987b commit e0400ce
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Expand Up @@ -2,6 +2,12 @@
Changes
-------

3.2.3
~~~~~

- fixes https://github.com/clld/clld/issues/122


3.2.2
~~~~~

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


__version__ = "3.2.2"
__version__ = "3.2.3"


class Resource(namedtuple('Resource', 'name model interface with_index with_rdfdump')):
Expand Down
12 changes: 9 additions & 3 deletions clld/tests/test_web_adapters_csv.py
Expand Up @@ -22,11 +22,17 @@ def test_CsvwJsonAdapter(self):
from clld.web.adapters.csv import CsvmJsonAdapter

adapter = CsvmJsonAdapter(None)
res = adapter.render(
datatables.Languages(self.env['request'], Language), self.env['request'])
self.assertIn('tableSchema', json.loads(res))
res = json.loads(adapter.render(
datatables.Languages(self.env['request'], Language), self.env['request']))
self.assertNotEqual(res['tableSchema']['columns'], [])

res = adapter.render(
datatables.Valuesets(self.env['request'], ValueSet), self.env['request'])
self.assertIn('foreignKeys', json.loads(res)['tableSchema'])
adapter.render_to_response(
datatables.Valuesets(self.env['request'], ValueSet), self.env['request'])

self._set_request_property('params', {'sSearch_0': 'xyz'})
res = json.loads(adapter.render(
datatables.Languages(self.env['request'], Language), self.env['request']))
self.assertEqual(res['tableSchema']['columns'], [])
3 changes: 2 additions & 1 deletion clld/web/adapters/csv.py
Expand Up @@ -129,10 +129,11 @@ def csvm_doc(cls, url, req, cols):

def render(self, ctx, req):
item = ctx.get_query(limit=1).first()
fields = item.csv_head() if item else []
cls = inspect(item).class_ if item else None
doc = self.csvm_doc(
req.url.replace('.csv-metadata.json', '.csv'),
req,
[(field, getattr(cls, field, None)) for field in item.csv_head()])
[(field, getattr(cls, field, None)) for field in fields])
doc["dc:title"] = "{0} - {1}".format(req.dataset.name, ctx)
return pyramid_render('json', doc, request=req)
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 = '3.2.2'
release = '3.2.3'

# The short X.Y version.
version = '3.2.2'
version = '3.2.3'

# 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 @@ -73,7 +73,7 @@

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

0 comments on commit e0400ce

Please sign in to comment.