[ckan-changes] [okfn/ckan] 1d75e8: [#728] Add ckan.tracking_enabled to app_globals

GitHub noreply at github.com
Wed Apr 17 16:22:47 UTC 2013


  Branch: refs/heads/release-v2.0
  Home:   https://github.com/okfn/ckan
  Commit: 1d75e8856742a52b7f694b82974511a484d6f74c
      https://github.com/okfn/ckan/commit/1d75e8856742a52b7f694b82974511a484d6f74c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/lib/app_globals.py

  Log Message:
  -----------
  [#728] Add ckan.tracking_enabled to app_globals

The ckan.tracking_enabled ini file setting was being ignored, so page
view tracking wasn't working. Adding ckan.tracking_enabled to
app_globals makes the setting work again.

Fixes #728


  Commit: 58e22c681fe8a3d883d3d9a750fea7f5043adf1a
      https://github.com/okfn/ckan/commit/58e22c681fe8a3d883d3d9a750fea7f5043adf1a
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/lib/cli.py

  Log Message:
  -----------
  [#729] Handle languages in URLs when updating page view tracking summary

Page view tracking was failing when a language was selected:

1. Put `ckan.tracking_enabled = true` in your ini file
2. Run CKAN, visit a page with a language e.g. `/en/dataset/annakarenina`
3. Run `paster tracking update`. If you look in your db, in the
   `tracking_summary` table there'll be a row with `package_id`
   `~~not~found~~`.
4. Run `paster tracking export tracking.csv`, the exported CSV file will
   say 0 views.

If you visit the page without the language in the URL e.g.
`/dataset/annakarenina` then run the export command again, the view does
get counted.

This commit fixes the SQL used by the `paster tracking update/export`
command to handle URLs with or without languages at the start.

Fixes #729


  Commit: ece6e8a8719cf015deb6f678df343f1ff773c93b
      https://github.com/okfn/ckan/commit/ece6e8a8719cf015deb6f678df343f1ff773c93b
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/index.rst
    A doc/tracking.rst

  Log Message:
  -----------
  [#541] Add docs for page view tracking feature

Add documentation for the page view tracking feature. There are still
some details to document, including how to show number of page views on
the pages themselves (eg. dataset views next to datasets) and how to
show "popular" labels next to popular datasets. It's also possible to
get a list of the N most popular datasets, for example for the front
page, perhaps this should be documented too.


  Commit: b2c6ec61e443608d9cabe53df898f987c47b0628
      https://github.com/okfn/ckan/commit/b2c6ec61e443608d9cabe53df898f987c47b0628
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    A doc/images/sort-datasets-by-popularity.png

  Log Message:
  -----------
  [#541] Add popularity-sorting screenshot

Should have been added in commit 3eeeef2 but I forgot.


  Commit: 9604dc1218a698bfcfddfd069b138456272009ab
      https://github.com/okfn/ckan/commit/9604dc1218a698bfcfddfd069b138456272009ab
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/templates/snippets/sort_by.html

  Log Message:
  -----------
  [#730] Only show 'Popular' sort option if tracking enabled

Sorting datasets by popularity only works if page view tracking is
enabled, so don't show the 'Popular' option in the 'Order by:' dropdown
if tracking isn't enabled.


  Commit: cfab9845bda2d162b16ff6f3537e456d9db7aa62
      https://github.com/okfn/ckan/commit/cfab9845bda2d162b16ff6f3537e456d9db7aa62
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/controllers/package.py
    M ckan/lib/search/query.py
    M ckan/logic/action/get.py
    M ckan/templates/snippets/sort_by.html

  Log Message:
  -----------
  [#714] Fix default sort ordering

Change the default sort order of package_search() to 'relevance asc,
metadata_modified desc'. We want to sort by relevance by default, but
when there's no search query relevance is meaningless, in that case fall
back on showing the most recently modified datasets first. Also changes
the sort ordering of the "Relevance" option in the "Order by:" dropdown
to 'relevance asc, metadata_modified desc' instead of just 'relevance
asc'.

The previous default ordering was 'score desc, name asc'. I'm not even
sure if that works, it seems to disagree with the sort strings that the
dropdown gives you, when you chose relevance from the dropdown you got
'relevance asc' not 'score desc' (and the datasets appeared in a
different order then the default), and when you chose name you get
'title_string' not name.

Previously we've fallen back on showing datasets alphabetically but
that's boring as it simply means that all the datasets beginning with 'a'
are always shown. Last modified seems more interesting and changes over
time. Popularity is not an option because that only works if the page
view tracking feature is enabled.

Move the logic that selects the default sort order for package_search()
out of lib and into package_search().

The package_search() action function now returns the sort order it used
in the 'sort' key of the returned dict, and the package controller sends
this to the templates to decide which sort ordering to show selected in
the "Order by:" dropdown. Previously the package controller and action
function each had their own logic and the dropdown was out of sync with
the actual sort order.

Fixes #714.


  Commit: ac445e403a80dbbecf0d913970d6f92a60d4ced9
      https://github.com/okfn/ckan/commit/ac445e403a80dbbecf0d913970d6f92a60d4ced9
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    A doc/images/popular-dataset.png
    A doc/images/popular-resource.png
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Add docs for highlighting popular datasets and resources

Also mention that tracking summary data is also available for resources
via the API, not just packages.


  Commit: fe22d9d85a6d2da036dcd3e220189cf7021d9528
      https://github.com/okfn/ckan/commit/fe22d9d85a6d2da036dcd3e220189cf7021d9528
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Document how to show dataset and resource view counts in templates


  Commit: 070396a9eb00bb890d2777d12d4e14f3bfed75c9
      https://github.com/okfn/ckan/commit/070396a9eb00bb890d2777d12d4e14f3bfed75c9
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Document showing most popular datasets on front page


  Commit: a66a36a951fc33ab712048ab584c464bded2d411
      https://github.com/okfn/ckan/commit/a66a36a951fc33ab712048ab584c464bded2d411
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Reference Google Analytics extension in Tracking docs


  Commit: 6bc544c24764da176ec92e70ab979442bf50e7ac
      https://github.com/okfn/ckan/commit/6bc544c24764da176ec92e70ab979442bf50e7ac
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/model/__init__.py
    M ckan/model/tracking.py

  Log Message:
  -----------
  [#730] Add tracking_raw_table to model

The tracking_raw table was being created by a migration script, but was
not actually defined anywhere in ckan's model. This means that in tests,
ckan.model.rebuild_db() would not clear the tracking_raw table, and the
old data would then leak it into tracking_summary as well. Adding
tracking_raw to the model makes rebuild_db() behave as expected again.


  Commit: e43dae5b9e2d3b56ec6f464ee22f43a158757905
      https://github.com/okfn/ckan/commit/e43dae5b9e2d3b56ec6f464ee22f43a158757905
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/logic/action/get.py

  Log Message:
  -----------
  [#730] Make sure 'sort' is always in package_search's data_dict

If data_dict contained no 'sort', the default value was not being added
if the data_dict did contain 'abort_search': True. The code nonetheless
tries to access data_dict['sort'] later on and crashes. (Isn't this what
schemas and validation are supposed to be for?) This was causing a test
to fail. Adding the default 'sort' value to data_dict even if
'abort_search': True is there fixes it.


  Commit: 7fc81b1425d314878ff627e73d2bdc734667c812
      https://github.com/okfn/ckan/commit/7fc81b1425d314878ff627e73d2bdc734667c812
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/tests/lib/test_solr_package_search.py

  Log Message:
  -----------
  [#714] Fix some solr package search tests

CKAN used to convert 'sort': 'rank' into 'sort': 'score desc, namae asc'
but since commit ca04063ce061fb80375e73d5aad865ebd6e0ae6d ([#714] Fix
default sort ordering) it no longer does this, which breaks these tests.
Update the tests to pass 'score desc, name asc' directly instead.


  Commit: 14690e464b1a1b84b46863b26ea6afc3bd7c43ae
      https://github.com/okfn/ckan/commit/14690e464b1a1b84b46863b26ea6afc3bd7c43ae
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/logic/action/get.py
    M ckan/templates/snippets/sort_by.html

  Log Message:
  -----------
  [#714] Use score not relevance in default sort order

'relevance' is not actually in the solr schema so it doesn't do
anything, score is the one we want.


  Commit: 53c0bf224791517d0b7fed7058c42413a843679c
      https://github.com/okfn/ckan/commit/53c0bf224791517d0b7fed7058c42413a843679c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/lib/create_test_data.py
    M ckan/tests/functional/test_pagination.py

  Log Message:
  -----------
  [#714] Fix pagination tests

Change create_arbitrary() to always create datasets in the same order,
instead of a different order each time. Update pagination tests to
expect datasets in the new default sort order.


  Commit: 1a994e31f0ab609db09e5983792e6cdf065522d8
      https://github.com/okfn/ckan/commit/1a994e31f0ab609db09e5983792e6cdf065522d8
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M ckan/tests/logic/test_action.py

  Log Message:
  -----------
  [#714] Fix an intermittently failing test

This test depends on the order of the two datasets. The default sort
order has changed now to most-recently-modified-first when there's no
search query, and since the test creates the two datasets in a random
order the search returns the datasets in a different order each time the
test is run, giving a 50/50 chance that the test will fail.

Change the test to not depend on the fixed order of the datasets.


  Commit: ea60e1e0e21053030878072d08c723fd109a7f3b
      https://github.com/okfn/ckan/commit/ea60e1e0e21053030878072d08c723fd109a7f3b
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Tweak page view tracking docs

Just clarify the docs a bit, and also mention that "recent" means last
14 days and that paster export is for datasets only.


  Commit: 5be9fa4fee89843acb2e4da3558d69240338c9a0
      https://github.com/okfn/ckan/commit/5be9fa4fee89843acb2e4da3558d69240338c9a0
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-16 (Tue, 16 Apr 2013)

  Changed paths:
    M doc/tracking.rst

  Log Message:
  -----------
  [#541] Small tweak to page view tracking docs


  Commit: 641e40341879cf1cfe2a7e17b23642f88b3e1da8
      https://github.com/okfn/ckan/commit/641e40341879cf1cfe2a7e17b23642f88b3e1da8
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/controllers/home.py
    M doc/configuration.rst

  Log Message:
  -----------
  Change demo.featured_groups name and add docs (Fixes #584)


  Commit: b55cd0e72ab24d9a6356467596f50cce8f8bb3f8
      https://github.com/okfn/ckan/commit/b55cd0e72ab24d9a6356467596f50cce8f8bb3f8
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M doc/configuration.rst

  Log Message:
  -----------
  [584] Specify that group names or ids are alllowed


  Commit: 11e808c417779d0c2ee72851f38d12503f3005ee
      https://github.com/okfn/ckan/commit/11e808c417779d0c2ee72851f38d12503f3005ee
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M doc/configuration.rst

  Log Message:
  -----------
  [584] Tweak documention per Tobby's suggestion


  Commit: d8362a1d9a2cf0c5dfc90564ea7cee63f5284350
      https://github.com/okfn/ckan/commit/d8362a1d9a2cf0c5dfc90564ea7cee63f5284350
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/logic/schema.py
    M ckan/logic/validators.py

  Log Message:
  -----------
  [#621] Move extras_validation into __before

This fixes an issue where creating a new resource would crash in
validation if there was a custom field (using convert_to/from_extras)
with a name that sorted after extras validation alphabetically. Fixes #621.


  Commit: 2c19a2a22cbfa256038361942b0af8c418723605
      https://github.com/okfn/ckan/commit/2c19a2a22cbfa256038361942b0af8c418723605
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/logic/validators.py

  Log Message:
  -----------
  [#621] Fix crash on duplicate extras key error

Fix a crash when generating a 'duplicate extras key' error. To trigger
the crash, post a dataset dict to package_create() containing two extras
dicts with the same key. There is no test for this yet.


  Commit: 0440e4478361182d2510a3962666ad930054ac81
      https://github.com/okfn/ckan/commit/0440e4478361182d2510a3962666ad930054ac81
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/tests/logic/test_action.py

  Log Message:
  -----------
  [#621] Add tests for duplicate extras key error

This code path was not covered by the tests.

Conflicts:

	ckan/tests/logic/test_action.py


  Commit: 10567acac73604c9f2f67a13ae2fd5778ff99d0c
      https://github.com/okfn/ckan/commit/10567acac73604c9f2f67a13ae2fd5778ff99d0c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/logic/validators.py
    M ckan/tests/logic/test_action.py

  Log Message:
  -----------
  [#621] Return duplicate extras key error in a list

This makes it consistent with other errors that CKAN returns.


  Commit: 4ccec75e7ad3ed8684160d181a763ac515bf70c4
      https://github.com/okfn/ckan/commit/4ccec75e7ad3ed8684160d181a763ac515bf70c4
  Author: amercader <amercadero at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/controllers/package.py
    M ckan/lib/app_globals.py
    M ckan/lib/cli.py
    M ckan/lib/create_test_data.py
    M ckan/lib/search/query.py
    M ckan/logic/action/get.py
    M ckan/model/__init__.py
    M ckan/model/tracking.py
    M ckan/templates/snippets/sort_by.html
    M ckan/tests/functional/test_pagination.py
    M ckan/tests/lib/test_solr_package_search.py
    M ckan/tests/logic/test_action.py
    A doc/images/popular-dataset.png
    A doc/images/popular-resource.png
    A doc/images/sort-datasets-by-popularity.png
    M doc/index.rst
    A doc/tracking.rst

  Log Message:
  -----------
  Merge branch 'tracking-fixes-branched-off-2.0' into release-v2.0


  Commit: a23e91d2bdb57168a0f184d2835554e95f855449
      https://github.com/okfn/ckan/commit/a23e91d2bdb57168a0f184d2835554e95f855449
  Author: amercader <amercadero at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/logic/action/create.py
    M ckan/logic/action/get.py
    M ckan/logic/action/update.py

  Log Message:
  -----------
  [#716] Allow to pass the schema as part of the context

In some cases extensions need to tweak the schema used on package
creation or update. For instance harvesters may want to create a package
with a certain id, or relax the default tags schema. There used to be an
option via `form_to_db_schema_options` to provide a custom schema via
the context, but this was removed on the last IDatasetForm refactor.

This adds back the option to pass the schema as part of the context.


  Commit: 01fd935daf772051dc7a337a91c3ef76cc46c5fc
      https://github.com/okfn/ckan/commit/01fd935daf772051dc7a337a91c3ef76cc46c5fc
  Author: John Glover <j at johnglover.net>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckanext/reclinepreview/theme/public/preview_recline.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.css
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.dataset.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.dataset.min.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.min.css
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.min.js

  Log Message:
  -----------
  [#702] Update Recline to latest master version.

Adds filter support for datastore backend and a
couple of other bug fixes.


  Commit: e62377d10bc19eb9bae46d5f16fcdbb40eacd4a7
      https://github.com/okfn/ckan/commit/e62377d10bc19eb9bae46d5f16fcdbb40eacd4a7
  Author: John Glover <j at johnglover.net>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.dataset.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.dataset.min.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.js
    M ckanext/reclinepreview/theme/public/vendor/recline/recline.min.js

  Log Message:
  -----------
  [#702] Lint and whitespace cleanup.


  Commit: a379cd7da8111faf7c5a666ef7628c5d3496ee18
      https://github.com/okfn/ckan/commit/a379cd7da8111faf7c5a666ef7628c5d3496ee18
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/logic/action/get.py

  Log Message:
  -----------
  Pass current user


  Commit: 84cb2f3be2fa77422b2d2e68195cc32ad8077683
      https://github.com/okfn/ckan/commit/84cb2f3be2fa77422b2d2e68195cc32ad8077683
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/tests/functional/api/test_dashboard.py

  Log Message:
  -----------
  Add a test


  Commit: 27d6c56dd8ced3ed1685175e021dc76676f46ac1
      https://github.com/okfn/ckan/commit/27d6c56dd8ced3ed1685175e021dc76676f46ac1
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/controllers/user.py
    M ckan/lib/helpers.py
    M ckan/logic/action/get.py
    M ckan/templates/activity_streams/activity_stream_items.html

  Log Message:
  -----------
  [#256] Remove id from dashboard activity list.

* Remove id from the dashboard activity list functions
* If offset is less than 30, show less should link to offset 0.


  Commit: 589c32d750d3e1023e6879bbcf96fd32fa9cd232
      https://github.com/okfn/ckan/commit/589c32d750d3e1023e6879bbcf96fd32fa9cd232
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/lib/helpers.py

  Log Message:
  -----------
  Revert the helper function signature


  Commit: 646dbef3dd5cd76192d3e77ca92bc0d408b8facb
      https://github.com/okfn/ckan/commit/646dbef3dd5cd76192d3e77ca92bc0d408b8facb
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/tests/functional/api/test_dashboard.py

  Log Message:
  -----------
  [#256] Fix the duplicate dataset test failure


  Commit: 4979e974e8ef678108636109f981f2b2074a4f6a
      https://github.com/okfn/ckan/commit/4979e974e8ef678108636109f981f2b2074a4f6a
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2013-04-17 (Wed, 17 Apr 2013)

  Changed paths:
    M ckan/tests/functional/api/test_dashboard.py

  Log Message:
  -----------
  [#256] Rename dashboard activity list test

* Rename dashboard activity list test for clarity.
* Remove extraneous print statement.


Compare: https://github.com/okfn/ckan/compare/b09a935d2a99...4979e974e8ef


More information about the ckan-changes mailing list