Skip to content

Commit

Permalink
[1819] make package dictize show capacity of dataset in group
Browse files Browse the repository at this point in the history
kindly committed Mar 27, 2012
1 parent 781fa3a commit d37198f
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/dictization/model_dictize.py
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ def package_dictize(pkg, context):
#groups
member_rev = model.member_revision_table
group = model.group_table
q = select([group],
q = select([group, member_rev.c.capacity],
from_obj=member_rev.join(group, group.c.id == member_rev.c.group_id)
).where(member_rev.c.table_id == pkg.id)\
.where(member_rev.c.state == 'active')
1 change: 0 additions & 1 deletion ckan/lib/search/index.py
Original file line number Diff line number Diff line change
@@ -173,7 +173,6 @@ def index_package(self, pkg_dict):
pass

# add a unique index_id to avoid conflicts

import hashlib
pkg_dict['index_id'] = hashlib.md5('%s%s' % (pkg_dict['id'],config.get('ckan.site_id'))).hexdigest()

2 changes: 2 additions & 0 deletions ckan/tests/lib/test_dictization.py
Original file line number Diff line number Diff line change
@@ -41,12 +41,14 @@ def setup_class(cls):
{'key': u'original media', 'state': u'active', 'value': u'"book"'}],
'groups': [{'description': u'These are books that David likes.',
'name': u'david',
'capacity': 'member',
'type': u'group',
'state': u'active',
'title': u"Dave's books",
"approval_status": u"approved"},
{'description': u'Roger likes these books.',
'name': u'roger',
'capacity': 'member',
'type': u'group',
'state': u'active',
'title': u"Roger's books",

0 comments on commit d37198f

Please sign in to comment.