# Conflicts:
#	README.rst
This commit is contained in:
Mikko Nieminen 2016-12-13 12:21:32 +02:00
commit 6a27a79b45
4 changed files with 22 additions and 2 deletions

View File

@ -34,8 +34,7 @@ To install ckanext-rating:
. /usr/lib/ckan/default/bin/activate
2. Install the ckanext-rating Python package into your virtual environment::
pip install ckanext-rating
pip install -e git+https://github.com/6aika/ckanext-rating.git#egg=ckanext-rating
3. Add ``rating`` to the ``ckan.plugins`` setting in your CKAN
config file (by default the config file is located at

View File

@ -0,0 +1,7 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)

View File

@ -50,7 +50,19 @@ def rating_package_create(context, data_dict):
return Rating.get_package_rating(package.id)
@toolkit.side_effect_free
def rating_package_get(context, data_dict):
'''
Get the rating and count of ratings for a package.
Returns a dictionary containing rating and ratings counts.
:param package_id: the id of the package
:type package_id: string
:rtype: dictionary
'''
package_id = data_dict.get('package_id')
error = None

View File

@ -55,6 +55,8 @@ setup(
# simple. Or you can use find_packages().
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
namespace_packages=['ckanext', 'ckanext.rating'],
# List run-time dependencies here. These will be installed by pip when your
# project is installed. For an analysis of "install_requires" vs pip's
# requirements files see: