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

Bitbucket commits-noreply at bitbucket.org
Mon Sep 19 14:38:11 UTC 2011


2 new changesets in ckanextiati:

http://bitbucket.org/okfn/ckanextiati/changeset/ca5db3db95eb/
changeset:   ca5db3db95eb
user:        amercader
date:        2011-09-19 16:28:44
summary:     Update package serialization patch
affected #:  1 file (-1 bytes)

--- a/ckanext/iati/patch.py	Fri Sep 16 15:18:51 2011 +0100
+++ b/ckanext/iati/patch.py	Mon Sep 19 15:28:44 2011 +0100
@@ -4,7 +4,6 @@
 import ckan.lib.helpers as h
 import ckan.authz as authz
 from ckan.lib.base import *
-from ckan.model import Package
 
 from ckanext.iati.controllers.group_schema import fields
 
@@ -12,14 +11,16 @@
 
 ######### 
 log.warn("Monkey-patching package serialization format!")
+from ckan.lib.dictization import model_dictize
 
-old = Package.as_dict
-def as_dict_with_groups_types(self):
-    _dict = old(self)
-    _dict['groups_types'] = "".join([g.extras.get('type', '') for g in self.groups])
+old2 = model_dictize.package_dictize
+def package_dictize_with_group_types(pkg,context):
+    _dict = old2(pkg,context)
+    _dict['groups_types'] = "".join([g.extras.get('type', '') for g in pkg.groups])
     return _dict
 
-Package.as_dict = as_dict_with_groups_types
+model_dictize.package_dictize = package_dictize_with_group_types
+
 ######### 
 
 FILE_TYPES = {


http://bitbucket.org/okfn/ckanextiati/changeset/266647d81f3c/
changeset:   266647d81f3c
user:        amercader
date:        2011-09-19 16:32:53
summary:     Update organisation spelling
affected #:  2 files (-1 bytes)

--- a/ckanext/iati/patch.py	Mon Sep 19 15:28:44 2011 +0100
+++ b/ckanext/iati/patch.py	Mon Sep 19 15:32:53 2011 +0100
@@ -25,7 +25,7 @@
 
 FILE_TYPES = {
     'activity':'Activity',
-    'organization':'Organization',
+    'organisation':'Organisation',
 }
 
 


--- a/ckanext/iati/templates/package/form_iati.html	Mon Sep 19 15:28:44 2011 +0100
+++ b/ckanext/iati/templates/package/form_iati.html	Mon Sep 19 15:32:53 2011 +0100
@@ -47,7 +47,7 @@
             <dd><select id="filetype" name="filetype"><option py:attrs="{'selected': 'selected' if data.get('filetype') == 'activity' else None}" value="activity">Activity</option>
-                    <option py:attrs="{'selected': 'selected' if data.get('filetype') == 'organization' else None}" value="organization">Organization</option>
+                    <option py:attrs="{'selected': 'selected' if data.get('filetype') == 'organisation' else None}" value="organisation">Organisation</option></select></dd>

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