[ckan-changes] commit/ckan: kindly: [search] bug 1256, fix modification extension so it pick up changes to revision objects
Bitbucket
commits-noreply at bitbucket.org
Tue Aug 2 22:57:46 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/c9db930797b5/
changeset: c9db930797b5
user: kindly
date: 2011-08-02 23:10:06
summary: [search] bug 1256, fix modification extension so it pick up changes to revision objects
affected #: 4 files (438 bytes)
--- a/ckan/model/package_extra.py Tue Aug 02 19:24:18 2011 +0100
+++ b/ckan/model/package_extra.py Tue Aug 02 22:10:06 2011 +0100
@@ -51,6 +51,8 @@
PackageExtraRevision= vdm.sqlalchemy.create_object_version(mapper, PackageExtra,
extra_revision_table)
+PackageExtraRevision.related_packages = lambda self: [self.continuity.package]
+
def _create_extra(key, value):
return PackageExtra(key=unicode(key), value=value)
--- a/ckan/model/package_mapping.py Tue Aug 02 19:24:18 2011 +0100
+++ b/ckan/model/package_mapping.py Tue Aug 02 22:10:06 2011 +0100
@@ -33,4 +33,9 @@
PackageRevision = vdm.sqlalchemy.create_object_version(mapper, Package,
package_revision_table)
+def related_packages(self):
+ return [self.continuity]
+PackageRevision.related_packages = related_packages
+
+
--- a/ckan/model/resource.py Tue Aug 02 19:24:18 2011 +0100
+++ b/ckan/model/resource.py Tue Aug 02 22:10:06 2011 +0100
@@ -203,6 +203,9 @@
ResourceGroupRevision = vdm.sqlalchemy.create_object_version(
mapper, ResourceGroup, resource_group_revision_table)
+ResourceGroupRevision.related_packages = lambda self: [self.continuity.package]
+ResourceRevision.related_packages = lambda self: [self.continuity.resouce_group.package]
+
import vdm.sqlalchemy.stateful
# TODO: move this into vdm
def add_stateful_m21(object_to_alter, m21_property_name,
--- a/ckan/model/tag.py Tue Aug 02 19:24:18 2011 +0100
+++ b/ckan/model/tag.py Tue Aug 02 22:10:06 2011 +0100
@@ -132,6 +132,7 @@
PackageTagRevision = vdm.sqlalchemy.create_object_version(mapper, PackageTag,
package_tag_revision_table)
+PackageTagRevision.related_packages = lambda self: [self.continuity.package]
from vdm.sqlalchemy.base import add_stateful_versioned_m2m
vdm.sqlalchemy.add_stateful_versioned_m2m(Package, PackageTag, 'tags', 'tag',
Repository URL: https://bitbucket.org/okfn/ckan/
--
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