[ckan-changes] [okfn/ckan] c3627b: [#1494][#1496] Save pkg and res in activity tables

noreply at github.com noreply at github.com
Fri Jan 6 18:20:34 UTC 2012

  Branch: refs/heads/feature-1515-activity-streams
  Home:   https://github.com/okfn/ckan

  Commit: c3627bb3aa01df6c48baee14cbe8b2f22a89c372
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-01-06 (Fri, 06 Jan 2012)

  Changed paths:
    M ckan/logic/action/get.py
  M ckan/model/activity.py
  M ckan/model/package.py
  M ckan/model/resource.py
  M ckan/templates/activity_streams/changed_package.html
  M ckan/templates/activity_streams/changed_resource.html
  M ckan/templates/activity_streams/new_package.html
  M ckan/templates/activity_streams/new_resource.html

  Log Message:
  [#1494][#1496] Save pkg and res in activity tables

When recording an activity or activity detail for a new or changed
package or resource, save a copy of the package or resource (dictized
and dumped as json) to the 'data' column of the activity or
activity_detail table.

In the activity stream templates get package and resource titles etc.
from this data, instead of querying the controller functions for them.

This means that if a package or resource name changes, old activity
events will still show the name from the time of the activity, if a
package or resource gets deleted old activity events will still have
access to the data, etc.

It also reduces extra database accesses when rendering activity streams.

And it means that this data about the package or resource that the
activity relates to is available in the json from the api call.

More information about the ckan-changes mailing list