[ECODP-dev] Patch for most viewed datasets (Release 09)

John Glover john.glover at okfn.org
Mon Oct 28 14:55:02 UTC 2013


Hi Bert,

The most viewed datasets patch has now been applied on the test server. I
have attached the diff file that can be used to make the patch, as well as
a copy of the file that should be produced by applying it.

To apply the patch:

patch
/applications/ecodp/users/ecodp/ckan/ecportal/src/ckanext-ecportal/ckanext/ecportal/mostviewed.py
<mostviewed.py.patch

Restart Apache.

The datasets (and counts) in the most viewed datasets listing should match
those returned by running the follow SQL command:

SELECT most_popular.url, most_popular.running_total,
           package.name, package.title
FROM (SELECT package_id, url, MAX(running_total) AS running_total
           FROM tracking_summary
           WHERE url LIKE('%/dataset/%')
           GROUP BY package_id, url) AS most_popular
INNER JOIN package ON most_popular.package_id = package.id
ORDER BY most_popular.running_total DESC
LIMIT 10;

Let me know if you have any questions.

Regards,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20131028/82df1de5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mostviewed.py.patch
Type: application/octet-stream
Size: 2579 bytes
Desc: not available
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20131028/82df1de5/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mostviewed.py
Type: text/x-python-script
Size: 653 bytes
Desc: not available
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20131028/82df1de5/attachment-0001.bin>


More information about the ecodp-dev mailing list