[ckan-changes] [okfn/ckan] 0c2107: [#1666] Add tag activities to activity streams

GitHub noreply at github.com
Wed Jan 18 16:49:33 UTC 2012


  Branch: refs/heads/feature-1515-activity-streams
  Home:   https://github.com/okfn/ckan
  Commit: 0c2107a051bef09646f567ed918cd9354610e5c8
      https://github.com/okfn/ckan/commit/0c2107a051bef09646f567ed918cd9354610e5c8
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-01-18 (Wed, 18 Jan 2012)

  Changed paths:
    M ckan/logic/action/get.py
  M ckan/model/tag.py
  A ckan/templates/activity_streams/added_tag.html
  A ckan/templates/activity_streams/removed_tag.html

  Log Message:
  -----------
  [#1666] Add tag activities to activity streams

Adds 'USER added/removed tag FOO to/from dataset BAR' activities to user
and dataset activity streams.

Currently whenever the activity streams session extension receives a
'changed PackageTag' event a 'removed tag' activity is emitted, assuming
that the change to the package tag was to set it's state to deleted. But
eventually we need proper detection of deletes versus changes, for other
objects (e.g. resources) as well as for tags.

Tests for this still need to be written.

'Added tag' and 'removed tag' activities show up as 'changed package'
activities with one 'added tag' or 'removed tag' activity detail. These
get rendered simply as 'USER added/removed the tag TAG to/from the
dataset DATASET' because when a 'changed package' activity has only one
activity detail that detail is rendered in place of the top-level
activity. (This is the same way that 'added resource' and 'updated
resource' activities work.)

If you make several changes to a dataset at once (e.g. adding and/or
removing multiple tags, or adding and/or removing tags and making other
changes) it shows up as a 'changed package' activity with multiple
activity details, and is rendered as a 'changed package' activity.

Details:

Add activity_stream_detail() function to PackageTag model class. Tag
events are generated by the activity streams session extension, not by
the logic functions.

Add added and removed tags rendering in ckan/logic/action/get.py, and
templates to ckan/templates/activity_streams/

The new tag activities already appear in the user and dataset's activity
streams.


  Commit: 4cdbe80897fca27b2ab7f871c2db2ecaf3994b2d
      https://github.com/okfn/ckan/commit/4cdbe80897fca27b2ab7f871c2db2ecaf3994b2d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-01-18 (Wed, 18 Jan 2012)

  Changed paths:
    A ckan/migration/versions/048_add_activity_streams_tables.py

  Log Message:
  -----------
  Merge branch 'feature-1515-activity-streams' of github.com:okfn/ckan into feature-1515-activity-streams


Compare: https://github.com/okfn/ckan/compare/afe155b...4cdbe80


More information about the ckan-changes mailing list