[ckan-changes] [okfn/ckan] d59e77: [2204] Added rest api support for related

GitHub noreply at github.com
Fri Apr 13 11:09:46 UTC 2012


  Branch: refs/heads/feature-2204-related
  Home:   https://github.com/okfn/ckan
  Commit: d59e77f3134cf0494870e44e894a0effb6b0c1a8
      https://github.com/okfn/ckan/commit/d59e77f3134cf0494870e44e894a0effb6b0c1a8
  Author: Ross Jones <rossdjones at gmail.com>
  Date:   2012-04-13 (Fri, 13 Apr 2012)

  Changed paths:
    M ckan/controllers/api.py
    M ckan/tests/functional/test_related.py

  Log Message:
  -----------
  [2204] Added rest api support for related


diff --git a/ckan/controllers/api.py b/ckan/controllers/api.py
index 4afef1a..a587f3d 100644
--- a/ckan/controllers/api.py
+++ b/ckan/controllers/api.py
@@ -235,6 +235,7 @@ def list(self, ver=None, register=None, subregister=None, id=None):
             'group': 'group_list',
             'dataset': 'package_list',
             'tag': 'tag_list',
+            'related': 'related_list',
             'licenses': 'licence_list',
             ('dataset', 'relationships'): 'package_relationships_list',
             ('dataset', 'revisions'): 'package_revision_list',
@@ -261,6 +262,7 @@ def show(self, ver=None, register=None, subregister=None, id=None, id2=None):
             'revision': 'revision_show',
             'group': 'group_show_rest',
             'tag': 'tag_show_rest',
+            'related': 'related_show',
             'dataset': 'package_show_rest',
             ('dataset', 'relationships'): 'package_relationships_list',
         }
@@ -294,6 +296,7 @@ def create(self, ver=None, register=None, subregister=None, id=None, id2=None):
              'group': 'group_create_rest',
              'dataset': 'package_create_rest',
              'rating': 'rating_create',
+             'related': 'related_create',
             ('dataset', 'relationships'): 'package_relationship_create_rest',
         }
         for type in model.PackageRelationship.get_all_types():
@@ -393,6 +396,7 @@ def delete(self, ver=None, register=None, subregister=None, id=None, id2=None):
         action_map = {
              'group': 'group_delete',
              'dataset': 'package_delete',
+             'related': 'related_delete',
             ('dataset', 'relationships'): 'package_relationship_delete_rest',
         }
         for type in model.PackageRelationship.get_all_types():
diff --git a/ckan/tests/functional/test_related.py b/ckan/tests/functional/test_related.py
index f4e9eee..142b828 100644
--- a/ckan/tests/functional/test_related.py
+++ b/ckan/tests/functional/test_related.py
@@ -148,7 +148,7 @@ def test_related_list(self):
         result = logic.get_action('related_list')(context,data_dict)
         assert len(result) == len(p.related)
 
-class TestRelatedAPI(base.BaseModelApiTestCase):
+class TestRelatedActionAPI(base.BaseModelApiTestCase):
 
     @classmethod
     def setup_class(cls):


================================================================



More information about the ckan-changes mailing list