Skip to content

Backports for ckan.plugins.toolkit to ease CKAN extension compatibility

Notifications You must be signed in to change notification settings

ckan/ckantoolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ckantoolkit

Circle CI

ckantoolkit is a library that wraps ckan.plugins.toolkit with backported attributes. This library is useful for writing extensions that work with a wide range of CKAN versions.

Example

# compatible with CKAN >= 2.5 only
from ckan.plugins.toolkit import ungettext

becomes:

# compatible with all CKAN versions!
from ckantoolkit import ungettext

ckantoolkit.tests

ckantoolkit includes a tests submodule that points to the correct ckan test module. e.g. If your extension builds on ckan's test factories your import code:

try:
    from ckan.tests.factories import Sysadmin
except ImportError: # for ckan <= 2.3
    from ckan.new_tests.factories import Sysadmin

becomes:

from ckantoolkit.tests.factories import Sysadmin

About

Backports for ckan.plugins.toolkit to ease CKAN extension compatibility

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages