[ckan-changes] [okfn/ckan] 4145f0: [#3005] Add model and API for following groups

GitHub noreply at github.com
Mon Nov 19 10:36:58 UTC 2012


  Branch: refs/heads/2939-orgs
  Home:   https://github.com/okfn/ckan
  Commit: 4145f00a4a046ad321183140d2c75fac0b55c651
      https://github.com/okfn/ckan/commit/4145f00a4a046ad321183140d2c75fac0b55c651
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-10-23 (Tue, 23 Oct 2012)

  Changed paths:
    M ckan/lib/activity_streams.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/lib/dictization/model_save.py
    M ckan/logic/action/create.py
    M ckan/logic/action/delete.py
    M ckan/logic/action/get.py
    M ckan/logic/converters.py
    M ckan/logic/schema.py
    M ckan/logic/validators.py
    A ckan/migration/versions/061_add_follower__group_table.py
    M ckan/model/__init__.py
    M ckan/model/follower.py

  Log Message:
  -----------
  [#3005] Add model and API for following groups

This implements everything required at the model and API level for following
and unfollowing of groups, getting a group's number of followers or a list of a
group's followers, and getting the number of groups that a user follows or a
list of the groups that a user follows.

Tests need to be added.

Frontend for following groups needs to be added.

+ Add UserFollowingGroup model class and user_following_group_dictize().

+ Add "{actor} started following {group}" activity stream activity.

+ Refactor user_following_user_dict_save() and
  user_following_dataset_dict_save(), replace with a single
  follower_dict_save() that can be used for UserFollowingUser,
  UserFollowingDataset, or UserFollowingGroup.

+ Add follow_group() and unfollow_group() logic action functions in create.py
  and delete.py.

+ Add group_follower_count(), group_follower_list(), am_following_group(),
  group_followee_count() and group_followee_list() logic action functions in
  get.py.

  Also refactor some code in logic/action/get.py to remove duplication between
  follower functions.

+ Add convert_group_name_or_id_to_id() converter function

+ Add default_follow_group_schema()

+ Add migration script


  Commit: 21429c6b7a10c31e0ea0be4c378e7c496b534d73
      https://github.com/okfn/ckan/commit/21429c6b7a10c31e0ea0be4c378e7c496b534d73
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-10-23 (Tue, 23 Oct 2012)

  Changed paths:
    M ckan/tests/functional/api/test_follow.py

  Log Message:
  -----------
  [#3005] Add tests for follow group API

Also refactored some test methods to remove code duplication between
user, dataset and group follower tests.

I started getting DetachedInstanceErrors from SQLAlchemy. It happens
because the tests access the model directly and retain references to
model objects. No idea why it started happening now but wasn't happening
before. I've added an AttributeDict hack at the top of the file to
remove this without introducing too much noise in the diff. Will remove
the hack and fix it properly in a separate commit.


  Commit: ee9eb3d98374b40c310459bb30216be48744896f
      https://github.com/okfn/ckan/commit/ee9eb3d98374b40c310459bb30216be48744896f
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-10-24 (Wed, 24 Oct 2012)

  Changed paths:
    M ckan/tests/functional/api/test_follow.py

  Log Message:
  -----------
  [#3005] Remove retained model objects from test_follow.py

This removes the AttributeDict hack introduced in the previous commit
(21429c6) and replaces retained model objects in the test module with
dicts so we don't DetachedInstanceErrors from SQLAlchemy.


  Commit: e55ca20ddf0068e7fb8d2a639cf406f14d0fa848
      https://github.com/okfn/ckan/commit/e55ca20ddf0068e7fb8d2a639cf406f14d0fa848
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-10-24 (Wed, 24 Oct 2012)

  Changed paths:
    M ckan/tests/functional/api/test_follow.py

  Log Message:
  -----------
  [#3005] Add tests for group following on delete cascade


  Commit: bc3ac6a1b4fe5787ed2100021d8b215d317fd083
      https://github.com/okfn/ckan/commit/bc3ac6a1b4fe5787ed2100021d8b215d317fd083
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-10-24 (Wed, 24 Oct 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    A ckan/templates/group/followers.html

  Log Message:
  -----------
  [#3005] Add group follow, unfollow and followers pages

These are not properly integrated into the frontend yet: no
follow/unfollow buttons on the group pages, no link to group followers
page, group followers page does not look right. But they work.


  Commit: beb1542b3cbf41c147dcbde8bd47c6d4a69c7889
      https://github.com/okfn/ckan/commit/beb1542b3cbf41c147dcbde8bd47c6d4a69c7889
  Author: John Martin <me at johnmart.in>
  Date:   2012-10-26 (Fri, 26 Oct 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    M ckan/lib/activity_streams.py
    M ckan/lib/helpers.py
    M ckan/public/base/javascript/modules/popover-context.js
    M ckan/public/base/javascript/resource.config
    M ckan/public/base/less/activity.less
    M ckan/public/base/less/ckan.less
    A ckan/templates/ajax_snippets/popover-context-group.html
    A ckan/templates/group/admins.html
    M ckan/templates/group/followers.html
    M ckan/templates/group/read.html
    M ckan/templates/user/read.html

  Log Message:
  -----------
  Added UI for the following/unfollowing of groups


  Commit: 61dc97b5367d58379bec6ca6baf2783575f669b2
      https://github.com/okfn/ckan/commit/61dc97b5367d58379bec6ca6baf2783575f669b2
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    M ckan/logic/action/get.py
    M ckan/public/base/css/main.css
    R ckan/public/base/less/disqus.less
    A ckan/templates/group/activity_stream.html
    M ckan/templates/package/snippets/resource_item.html
    M ckan/tests/functional/api/test_activity.py
    M doc/_themes/sphinx-theme-okfn
    R doc/howto-editing-database-ownership.rst
    M doc/paster.rst

  Log Message:
  -----------
  Merged master


  Commit: 88166e86e33887320e7ce2be12f6bd3dbc10cc47
      https://github.com/okfn/ckan/commit/88166e86e33887320e7ce2be12f6bd3dbc10cc47
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/controllers/group.py

  Log Message:
  -----------
  Fix after incorrect merge


  Commit: eaef0364f32f18413dafe6a5d2a55338c06e0262
      https://github.com/okfn/ckan/commit/eaef0364f32f18413dafe6a5d2a55338c06e0262
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/templates/group/activity_stream.html
    M ckan/templates/group/read.html

  Log Message:
  -----------
  Added activity stream to group front end


  Commit: 35903c6477253962c3fb622399622601ebc248a0
      https://github.com/okfn/ckan/commit/35903c6477253962c3fb622399622601ebc248a0
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/templates/group/activity_stream.html

  Log Message:
  -----------
  Added page title to the group activity stream page


  Commit: 3d0361c74f2b79fd9dadac83a53ad280636386b4
      https://github.com/okfn/ckan/commit/3d0361c74f2b79fd9dadac83a53ad280636386b4
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/logic/action/get.py
    M ckan/public/base/javascript/modules/popover-context.js

  Log Message:
  -----------
  [#3005] Add num_followers to group_dict returned by group_read

So that templates can access a group's number of followers without
having to make another API call.


  Commit: be2505cf67fce6f374f56de07126422d1cc816c6
      https://github.com/okfn/ckan/commit/be2505cf67fce6f374f56de07126422d1cc816c6
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/tests/functional/test_activity.py

  Log Message:
  -----------
  Fix a broken activity streams test


  Commit: 5a66e8c018c6eae6e429de0eb30ef4e2d5a0106b
      https://github.com/okfn/ckan/commit/5a66e8c018c6eae6e429de0eb30ef4e2d5a0106b
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-05 (Mon, 05 Nov 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    M ckan/lib/activity_streams.py
    A ckan/templates/group/about.html
    M ckan/templates/group/read.html

  Log Message:
  -----------
  Added about page to groups and fixed the truncate error on group/read.html


  Commit: a9696042653da977e7f813c91ffa85faac55aa3e
      https://github.com/okfn/ckan/commit/a9696042653da977e7f813c91ffa85faac55aa3e
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-06 (Tue, 06 Nov 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    M ckan/lib/activity_streams.py
    A ckan/templates/group/about.html
    M ckan/templates/group/read.html

  Log Message:
  -----------
  Merge branch 'feature-3005-add-following-of-groups' of github.com:okfn/ckan into feature-3005-add-following-of-groups


  Commit: 115e70326ff2eef3f42b33c79b77ad55866ef5cf
      https://github.com/okfn/ckan/commit/115e70326ff2eef3f42b33c79b77ad55866ef5cf
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-06 (Tue, 06 Nov 2012)

  Changed paths:
    M ckan/controllers/group.py

  Log Message:
  -----------
  [#3005] Add back c.group_admins on group read teamplate

It's used by the legacy templates to show a list of the group's admins
in the sidebar. Legacy templates do not support the new group admins
page. This fixes a frontend test that was failing while testing the
legacy templates.


  Commit: be08fbf7f0122c591faf2ebfcf21403d5398065b
      https://github.com/okfn/ckan/commit/be08fbf7f0122c591faf2ebfcf21403d5398065b
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2012-11-10 (Sat, 10 Nov 2012)

  Changed paths:
    M doc/common-error-messages.rst

  Log Message:
  -----------
  Restructured doc to improve display with latest doc theme


  Commit: 984d49ebf0a1dc8f881fcbfeaf0f876b4a0c6547
      https://github.com/okfn/ckan/commit/984d49ebf0a1dc8f881fcbfeaf0f876b4a0c6547
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-12 (Mon, 12 Nov 2012)

  Changed paths:
    M ckan/controllers/group.py

  Log Message:
  -----------
  [#3005] Remove some unnecessary default param values


  Commit: 8cdd117bb1ba22e7e9fa962ed9aea8152edae424
      https://github.com/okfn/ckan/commit/8cdd117bb1ba22e7e9fa962ed9aea8152edae424
  Author: John Martin <me at johnmart.in>
  Date:   2012-11-14 (Wed, 14 Nov 2012)

  Changed paths:
    M ckan/public/base/less/iehacks.less

  Log Message:
  -----------
  Couple of minor IE hack CSS tweaks to 2.0 theme


  Commit: 8eff1125162479458166c830fd767fd5c72b3a00
      https://github.com/okfn/ckan/commit/8eff1125162479458166c830fd767fd5c72b3a00
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2012-11-14 (Wed, 14 Nov 2012)

  Changed paths:
    M doc/common-error-messages.rst

  Log Message:
  -----------
  Put the common error messages in a semantically correct dd/dt. Thanks to @seanh for pointing it out.


  Commit: e61501202500810c380e4580279e1546d76e4526
      https://github.com/okfn/ckan/commit/e61501202500810c380e4580279e1546d76e4526
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M doc/common-error-messages.rst

  Log Message:
  -----------
  Merge branch '3013-common-error-messages-doc-fix'


  Commit: 81385c76c3f69bd2f252bc588bb9178a9141adcb
      https://github.com/okfn/ckan/commit/81385c76c3f69bd2f252bc588bb9178a9141adcb
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M ckan/public/base/less/iehacks.less

  Log Message:
  -----------
  Merge branch 'master' of github.com:okfn/ckan


  Commit: be4ed0e392ffb834b4287ed5937748908f91885e
      https://github.com/okfn/ckan/commit/be4ed0e392ffb834b4287ed5937748908f91885e
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M ckan/public/base/less/iehacks.less
    M doc/common-error-messages.rst

  Log Message:
  -----------
  Merge branch 'master' of github.com:okfn/ckan into feature-3005-add-following-of-groups


  Commit: 1dd0f03acdb7119ffdae48fa3345d36a47760611
      https://github.com/okfn/ckan/commit/1dd0f03acdb7119ffdae48fa3345d36a47760611
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M ckan/controllers/group.py

  Log Message:
  -----------
  Merge branch 'feature-3005-add-following-of-groups'


  Commit: d917e738abcd22918a13e3b1f4c228d187f111d1
      https://github.com/okfn/ckan/commit/d917e738abcd22918a13e3b1f4c228d187f111d1
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M ckan/templates/user/dashboard.html

  Log Message:
  -----------
  Don't show "Add Dataset" on dash if user cannot

Only show the "Add new dataset" button on the user's dashboard if the
user has permission to add new datasets.


  Commit: 200c243681bce88c2ae6f55c074a0c9f253cbaab
      https://github.com/okfn/ckan/commit/200c243681bce88c2ae6f55c074a0c9f253cbaab
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-15 (Thu, 15 Nov 2012)

  Changed paths:
    M ckan/templates/user/dashboard.html

  Log Message:
  -----------
  Change "Add new dataset" to "Add Dataset"

Text on button on user's dashboard. Make it match "Add Dataset" link in
site header, "Add Dataset" and "Add Dataset to Group" buttons on group
pages, etc.


  Commit: d326da5fb42617a6a5282f6ac87bbbb8e8613752
      https://github.com/okfn/ckan/commit/d326da5fb42617a6a5282f6ac87bbbb8e8613752
  Author: tobes <toby.junk at gmail.com>
  Date:   2012-11-19 (Mon, 19 Nov 2012)

  Changed paths:
    M ckan/config/routing.py
    M ckan/controllers/group.py
    M ckan/lib/activity_streams.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/lib/dictization/model_save.py
    M ckan/lib/helpers.py
    M ckan/logic/action/create.py
    M ckan/logic/action/delete.py
    M ckan/logic/action/get.py
    M ckan/logic/converters.py
    M ckan/logic/schema.py
    M ckan/logic/validators.py
    A ckan/migration/versions/061_add_follower__group_table.py
    M ckan/model/__init__.py
    M ckan/model/follower.py
    M ckan/public/base/javascript/modules/popover-context.js
    M ckan/public/base/javascript/resource.config
    M ckan/public/base/less/activity.less
    M ckan/public/base/less/iehacks.less
    A ckan/templates/ajax_snippets/popover-context-group.html
    A ckan/templates/group/about.html
    M ckan/templates/group/activity_stream.html
    A ckan/templates/group/admins.html
    A ckan/templates/group/followers.html
    M ckan/templates/group/read.html
    M ckan/templates/user/dashboard.html
    M ckan/templates/user/read.html
    M ckan/tests/functional/api/test_follow.py
    M ckan/tests/functional/test_activity.py
    M doc/common-error-messages.rst

  Log Message:
  -----------
  Merge branch 'master' into 2939-orgs

Conflicts:
	ckan/controllers/group.py
	ckan/logic/action/create.py
	ckan/logic/action/delete.py
	ckan/logic/schema.py
	ckan/logic/validators.py
	ckan/templates/group/read.html

trivial merges


  Commit: a58b54fed8bdc57246cc0fae36450cd55b9f6884
      https://github.com/okfn/ckan/commit/a58b54fed8bdc57246cc0fae36450cd55b9f6884
  Author: tobes <toby.junk at gmail.com>
  Date:   2012-11-19 (Mon, 19 Nov 2012)

  Changed paths:
    R ckan/migration/versions/061_org_changes.py
    A ckan/migration/versions/062_org_changes.py

  Log Message:
  -----------
  [#2939] rename migrate to avoid conflict with master


  Commit: 5c948ff5b81fac18745041626543d30c78798982
      https://github.com/okfn/ckan/commit/5c948ff5b81fac18745041626543d30c78798982
  Author: tobes <toby.junk at gmail.com>
  Date:   2012-11-19 (Mon, 19 Nov 2012)

  Changed paths:
    M ckan/new_authz.py
    M ckan/tests/logic/test_auth.py

  Log Message:
  -----------
  [#2939] Fix test test_04_modify_group


  Commit: c2361489d47cd4dc927842aa1b0d49b133695e5b
      https://github.com/okfn/ckan/commit/c2361489d47cd4dc927842aa1b0d49b133695e5b
  Author: tobes <toby.junk at gmail.com>
  Date:   2012-11-19 (Mon, 19 Nov 2012)

  Changed paths:
    M ckan/tests/logic/test_auth.py

  Log Message:
  -----------
  [#2939] Fix test test_03_add_dataset_to_group


Compare: https://github.com/okfn/ckan/compare/9601e41edc76...c2361489d47c


More information about the ckan-changes mailing list