[ckan-dev] followers and thoughts

Toby Dacre toby.okfn at gmail.com
Thu May 31 18:55:53 UTC 2012


Hi,

I've had a look at the followers stuff following a bug I found, and looking
to add it to the demo site.

I'd like to move the logic from the controllers into a helper function.
The reason for this is that it means that we don't need to do the work
finding followers if the feature isn't being used in a particular ckan
instance.  It also decouples it from the controllers so it would be
available even with a customised controller.

essentially I'd remove the follower stuff from the controllers and get the
helper function to do the work.  All the logic work would remain the same.
It isn't yet in a released version of ckan so no-one should be affected.

so we'd end up with something close to h.follow_button('dataset', pkg_id),
h.follow_numbers('user', user_name)

part of the reason for this is situations like the ckan index page building
the recent activity stream but not then displaying it. So all ckan
instances end up taking a hit because of the needs of a few instances. I'd
like to slowly move such things out of the controllers where
possible/appropriate. Unfortunately pylons doesn't seem to let us use
@property to help the transition.  It should also make our code more
resiliant and simple.

What do people think of about this approach both specifically for followers
and more generally

cheers
Toby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120531/57cab373/attachment.html>


More information about the ckan-dev mailing list