Merge branch 'master' of https://github.com/6aika/ckanext-rating
# Conflicts: # README.rst
This commit is contained in:
commit
6a27a79b45
|
@ -34,8 +34,7 @@ To install ckanext-rating:
|
||||||
. /usr/lib/ckan/default/bin/activate
|
. /usr/lib/ckan/default/bin/activate
|
||||||
|
|
||||||
2. Install the ckanext-rating Python package into your virtual environment::
|
2. Install the ckanext-rating Python package into your virtual environment::
|
||||||
|
pip install -e git+https://github.com/6aika/ckanext-rating.git#egg=ckanext-rating
|
||||||
pip install ckanext-rating
|
|
||||||
|
|
||||||
3. Add ``rating`` to the ``ckan.plugins`` setting in your CKAN
|
3. Add ``rating`` to the ``ckan.plugins`` setting in your CKAN
|
||||||
config file (by default the config file is located at
|
config file (by default the config file is located at
|
||||||
|
|
|
@ -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__)
|
|
@ -50,7 +50,19 @@ def rating_package_create(context, data_dict):
|
||||||
|
|
||||||
return Rating.get_package_rating(package.id)
|
return Rating.get_package_rating(package.id)
|
||||||
|
|
||||||
|
|
||||||
|
@toolkit.side_effect_free
|
||||||
def rating_package_get(context, data_dict):
|
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')
|
package_id = data_dict.get('package_id')
|
||||||
|
|
||||||
error = None
|
error = None
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -55,6 +55,8 @@ setup(
|
||||||
# simple. Or you can use find_packages().
|
# simple. Or you can use find_packages().
|
||||||
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
|
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
|
# 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
|
# project is installed. For an analysis of "install_requires" vs pip's
|
||||||
# requirements files see:
|
# requirements files see:
|
||||||
|
|
Loading…
Reference in New Issue