[ckan-changes] commit/ckanextiati: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Oct 4 13:21:01 UTC 2011


2 new changesets in ckanextiati:

http://bitbucket.org/okfn/ckanextiati/changeset/5963c2b2d697/
changeset:   5963c2b2d697
user:        amercader
date:        2011-10-04 15:20:07
summary:     Another monkey patch needed to be able to index extras_publishertype
affected #:  1 file (-1 bytes)

--- a/ckanext/iati/patch.py	Thu Sep 22 14:40:23 2011 +0100
+++ b/ckanext/iati/patch.py	Tue Oct 04 14:20:07 2011 +0100
@@ -19,11 +19,23 @@
 
 old_as_dict = Package.as_dict
 def as_dict_with_groups_types(self):
+#    import pdb; pdb.set_trace()
     _dict = old_as_dict(self)
     _dict['extras']['publishertype'] = ''.join([g.extras.get('type', '') for g in self.groups])
     return _dict
 
 Package.as_dict = as_dict_with_groups_types
+
+from ckan.lib.dictization import model_dictize
+old_package_to_api1 = model_dictize.package_to_api1
+
+def package_to_api1_with_groups_types(pkg,context):
+    _dict = old_package_to_api1(pkg,context) 
+    _dict['extras']['publishertype'] = ''.join([g.extras.get('type', '') for g in pkg.groups])
+    return _dict
+
+model_dictize.package_to_api1 = package_to_api1_with_groups_types
+
 ######### 
 
 


http://bitbucket.org/okfn/ckanextiati/changeset/47b39c1b3c8b/
changeset:   47b39c1b3c8b
user:        amercader
date:        2011-10-04 15:20:32
summary:     Update query to use latest ckan version
affected #:  1 file (-1 bytes)

--- a/ckanext/iati/templates/package/search_form.html	Tue Oct 04 14:20:07 2011 +0100
+++ b/ckanext/iati/templates/package/search_form.html	Tue Oct 04 14:20:32 2011 +0100
@@ -6,7 +6,7 @@
     from ckan.model import Package
 
     global_query = query_for(Package)
-    global_query.run(facet_by=g.facets)
+    global_query.run({'facet.field':g.facets})
     global_facets = global_query.facets
 
     any = ('', 'Any')

Repository URL: https://bitbucket.org/okfn/ckanextiati/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list