[ckan-changes] [ckan/ckan] d14e32: Reduces the number of calls to get_package_type.

GitHub noreply at github.com
Mon Nov 24 18:52:55 UTC 2014


  Branch: refs/heads/2080-reduce-use-of-get-package-type
  Home:   https://github.com/ckan/ckan
  Commit: d14e32d438da3947017e9fcc5362535d62e3b9a0
      https://github.com/ckan/ckan/commit/d14e32d438da3947017e9fcc5362535d62e3b9a0
  Author: Ross Jones <ross at servercode.co.uk>
  Date:   2014-11-24 (Mon, 24 Nov 2014)

  Changed paths:
    M ckan/controllers/package.py

  Log Message:
  -----------
  Reduces the number of calls to get_package_type.

get_package_type in the package controller is called at the start of
several functions to retrieve the type field of the package - this is
done with a direct database call.  Most of these methods will go on to
call package_show before needing the value of package_type, and so this
PR removes lots of the calls and replaces them with pkg_dict accesses
closer to the where it is needed.

_get_package_type comment has also changed to more closely reflect what
it actually does (rather than what we wish it did).

This should close #2080




More information about the ckan-changes mailing list