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

GitHub noreply at github.com
Mon Nov 12 13:26:25 UTC 2012


  Branch: refs/heads/DO_NOT_MERGE_3010-serve-unminified-files-in-production-hack
  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: 25795fb5165489f81b1ed2e057a2179e8fe198e9
      https://github.com/okfn/ckan/commit/25795fb5165489f81b1ed2e057a2179e8fe198e9
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-12 (Mon, 12 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
    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/read.html
    M ckan/tests/functional/api/test_follow.py
    M ckan/tests/functional/test_activity.py

  Log Message:
  -----------
  Merge branch 'master' of github.com:okfn/ckan into DO_NOT_MERGE_3010-serve-unminified-files-in-production-hack


Compare: https://github.com/okfn/ckan/compare/e66c0f70c14d...25795fb51654


More information about the ckan-changes mailing list