Skip to content

Commit

Permalink
[merge] from release-v1.3.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Apr 21, 2011
2 parents 34d40d0 + a9cc3cd commit 4744e66
Show file tree
Hide file tree
Showing 93 changed files with 3,675 additions and 3,325 deletions.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ fl_notes.txt
*.ini
.noseids
*~

17 changes: 17 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
CKAN CHANGELOG
++++++++++++++

v1.3.4 2011-XX-XX
=================
Major:
* Refactor internal logic to all use packages in one format - a dictionary (#1046)
* A new button for administrators to change revisions to/from a deleted state (#1076)

Minor:
* Etags caching can now be disabled in config (#840)
* Command-line tool to check search index covers all packages (#1073)
* Command-line tool to load/dump postgres database (#1067)

Bug fixes:
* Visitor can't create packages on new CKAN install - since v1.3.3 (#1090)
* OpenID user pages couldn't be accessed - since v1.3.2 (#1056)
* Default site_url configured to ckan.net, so pages obtains CSS from ckan.net- since v1.3 (#1085)


v1.3.3 2011-04-08
=================
Major:
Expand Down
4 changes: 3 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ tests. See: http://buildbot.okfn.org/waterfall
python-virtualenv Python virtual environments
wget Command line tool for downloading from the web
build-essential Tools for building source code
git-core Git source control (for MarkupSafe)
git-core Git source control (for getting MarkupSafe src)
subversion Subversion source control (for pyutilib)
===================== ===============================================

For ubuntu you can install these like so:
Expand All @@ -43,6 +44,7 @@ tests. See: http://buildbot.okfn.org/waterfall
sudo apt-get install build-essential libxml2-dev libxslt-dev
sudo apt-get install wget mercurial postgresql libpq-dev git-core
sudo apt-get install python-dev python-psycopg2 python-virtualenv
sudo apt-get install subversion

2. Create a python virtual environment

Expand Down
2 changes: 1 addition & 1 deletion ckan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.3.3'
__version__ = '1.4a'
__description__ = 'Comprehensive Knowledge Archive Network (CKAN) Software'
__long_description__ = \
'''The CKAN software is used to run the Comprehensive Knowledge Archive
Expand Down
11 changes: 6 additions & 5 deletions ckan/ckan_nose_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
pylonsapp = None

class CkanNose(Plugin):
settings = None

def startContext(self, ctx):
# import needs to be here or setup happens too early
Expand All @@ -16,11 +17,11 @@ def startContext(self, ctx):
if isclass(ctx):
if hasattr(ctx, "no_db") and ctx.no_db:
return
if self.is_first_test or self.options.ckan_migration:
if self.is_first_test or CkanNose.settings.ckan_migration:
model.Session.close_all()
model.repo.clean_db()
self.is_first_test = False
if self.options.ckan_migration:
if CkanNose.settings.ckan_migration:
model.Session.close_all()
model.repo.upgrade_db()
# init_db is run at the start of every class because
Expand All @@ -40,8 +41,8 @@ def options(self, parser, env):
dest='ckan_migration',
help='set this when wanting to test migrations')

def configure(self, options, config):
self.options = options
if options.is_ckan:
def configure(self, settings, config):
CkanNose.settings = settings
if settings.is_ckan:
self.enabled = True
self.is_first_test = True
16 changes: 9 additions & 7 deletions ckan/config/deployment.ini_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ who.log_file = %(cache_dir)s/who_log.ini
auth.admins =

# CKAN caching
cache_enabled = False
ckan.cache_enabled = False
ckan.cache_validation_enabled = True
# cache to persistent files
beaker.cache.type = file
# default expiry time for the cache (where not specified specifically)
Expand Down Expand Up @@ -128,8 +129,9 @@ ckan.site_logo = http://assets.okfn.org/p/ckan/img/ckan_logo_largetext.png
## Site tagline / description (used on front page)
ckan.site_description =

## Used in creating some absolute urls (such as rss feeds) and dump filenames
ckan.site_url = http://www.ckan.net
## Used in creating some absolute urls (such as rss feeds, css files) and
## dump filenames
ckan.site_url =

## Favicon (default is the CKAN software favicon)
ckan.favicon = http://assets.okfn.org/p/ckan/img/ckan.ico
Expand Down Expand Up @@ -158,10 +160,10 @@ ckan.dump_dir = %(here)s/dump
ckan.backup_dir = %(here)s/backup

# Default authorizations for new domain objects
ckan.default_roles.Package = {"visitor": ["editor"], "logged_in": ["editor"]}
ckan.default_roles.Group = {"visitor": ["reader"], "logged_in": ["reader"]}
ckan.default_roles.System = {"visitor": ["reader"], "logged_in": ["editor"]}
ckan.default_roles.AuthorizationGroup = {"visitor": ["reader"], "logged_in": ["reader"]}
#ckan.default_roles.Package = {"visitor": ["editor"], "logged_in": ["editor"]}
#ckan.default_roles.Group = {"visitor": ["reader"], "logged_in": ["reader"]}
#ckan.default_roles.System = {"visitor": ["anon_editor"], "logged_in": ["editor"]}
#ckan.default_roles.AuthorizationGroup = {"visitor": ["reader"], "logged_in": ["reader"]}

# Logging configuration
[loggers]
Expand Down
204 changes: 63 additions & 141 deletions ckan/config/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,181 +31,101 @@ def make_map():
map.connect('/language.js', controller='home', action='language')
map.connect('/locale', controller='home', action='locale')
map.connect('about', '/about', controller='home', action='about')
# CKAN API.
map.connect('/api', controller='rest', action='get_api')

map.connect('/api/search/:register', controller='rest', action='search')
map.connect('/api/tag_counts', controller='rest', action='tag_counts')

map.connect('/api/rest', controller='rest', action='index')

map.connect('/api/rest/package', controller='apiv1/package', action='list',
conditions=dict(method=['GET']))
map.connect('/api/rest/package', controller='apiv1/package', action='create',
conditions=dict(method=['POST']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='show',
conditions=dict(method=['GET']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['POST']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='delete',
conditions=dict(method=['DELETE']))
# CKAN API versioned.
map.connect('/api/{ver:1|2}', controller='api', action='get_api')

map.connect('/api/rest/package', controller='apiv1/package', action='list',
conditions=dict(method=['GET']))
map.connect('/api/rest/package', controller='apiv1/package', action='create',
conditions=dict(method=['POST']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='show',
conditions=dict(method=['GET']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['POST']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/rest/package/:id', controller='apiv1/package', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/{ver:1|2}/search/:register', controller='api', action='search')
map.connect('/api/{ver:1|2}/tag_counts', controller='api', action='tag_counts')

map.connect('/api/rest/:register', controller='rest', action='list',
map.connect('/api/{ver:1|2}/rest', controller='api', action='index')

map.connect('/api/{ver:1|2}/rest/:register', controller='api', action='list',
conditions=dict(method=['GET']))
map.connect('/api/rest/:register', controller='rest', action='create',
map.connect('/api/{ver:1|2}/rest/:register', controller='api', action='create',
conditions=dict(method=['POST']))
map.connect('/api/rest/:register/:id', controller='rest', action='show',
map.connect('/api/{ver:1|2}/rest/:register/:id', controller='api', action='show',
conditions=dict(method=['GET']))
map.connect('/api/rest/:register/:id', controller='rest', action='update',
map.connect('/api/{ver:1|2}/rest/:register/:id', controller='api', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/rest/:register/:id', controller='rest', action='update',
map.connect('/api/{ver:1|2}/rest/:register/:id', controller='api', action='update',
conditions=dict(method=['POST']))
map.connect('/api/rest/:register/:id', controller='rest', action='delete',
map.connect('/api/{ver:1|2}/rest/:register/:id', controller='api', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/rest/:register/:id/:subregister',
controller='rest', action='list',
map.connect('/api/{ver:1|2}/rest/:register/:id/:subregister',
controller='api', action='list',
conditions=dict(method=['GET']))
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='rest', action='create',
map.connect('/api/{ver:1|2}/rest/:register/:id/:subregister/:id2',
controller='api', action='create',
conditions=dict(method=['POST']))
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='rest', action='show',
map.connect('/api/{ver:1|2}/rest/:register/:id/:subregister/:id2',
controller='api', action='show',
conditions=dict(method=['GET']))
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='rest', action='update',
map.connect('/api/{ver:1|2}/rest/:register/:id/:subregister/:id2',
controller='api', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='rest', action='delete',
map.connect('/api/{ver:1|2}/rest/:register/:id/:subregister/:id2',
controller='api', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/qos/throughput/',
controller='rest', action='throughput',
map.connect('/api/{ver:1|2}/qos/throughput/',
controller='api', action='throughput',
conditions=dict(method=['GET']))

# CKAN API v1.
map.connect('/api/1', controller='rest', action='get_api')

map.connect('/api/1/search/:register', controller='rest', action='search')
map.connect('/api/1/tag_counts', controller='rest', action='tag_counts')

map.connect('/api/1/rest', controller='rest', action='index')
# CKAN API unversioned.
map.connect('/api', controller='api', action='get_api')

map.connect('/api/1/rest/package', controller='apiv1/package', action='list',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/package', controller='apiv1/package', action='create',
conditions=dict(method=['POST']))
map.connect('/api/1/rest/package/:id', controller='apiv1/package', action='show',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['POST']))
map.connect('/api/1/rest/package/:id', controller='apiv1/package', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/1/rest/package/:id', controller='apiv1/package', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/search/:register', controller='api', action='search')
map.connect('/api/tag_counts', controller='api', action='tag_counts')

map.connect('/api/rest', controller='api', action='index')

map.connect('/api/1/rest/:register', controller='rest', action='list',
map.connect('/api/rest/:register', controller='api', action='list',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/:register', controller='rest', action='create',
map.connect('/api/rest/:register', controller='api', action='create',
conditions=dict(method=['POST']))
map.connect('/api/1/rest/:register/:id', controller='rest', action='show',
map.connect('/api/rest/:register/:id', controller='api', action='show',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/:register/:id', controller='rest', action='update',
map.connect('/api/rest/:register/:id', controller='api', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/1/rest/:register/:id', controller='rest', action='update',
map.connect('/api/rest/:register/:id', controller='api', action='update',
conditions=dict(method=['POST']))
map.connect('/api/1/rest/:register/:id', controller='rest', action='delete',
map.connect('/api/rest/:register/:id', controller='api', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/1/rest/:register/:id/:subregister',
controller='rest', action='list',
map.connect('/api/rest/:register/:id/:subregister',
controller='api', action='list',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/:register/:id/:subregister/:id2',
controller='rest', action='create',
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='api', action='create',
conditions=dict(method=['POST']))
map.connect('/api/1/rest/:register/:id/:subregister/:id2',
controller='rest', action='show',
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='api', action='show',
conditions=dict(method=['GET']))
map.connect('/api/1/rest/:register/:id/:subregister/:id2',
controller='rest', action='update',
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='api', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/1/rest/:register/:id/:subregister/:id2',
controller='rest', action='delete',
map.connect('/api/rest/:register/:id/:subregister/:id2',
controller='api', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/1/qos/throughput/',
controller='rest', action='throughput',
map.connect('/api/qos/throughput/',
controller='api', action='throughput',
conditions=dict(method=['GET']))

# CKAN API v2.
map.connect('/api/2', controller='rest2', action='get_api')

map.connect('/api/2/search/:register', controller='rest2', action='search')
map.connect('/api/2/tag_counts', controller='rest2', action='tag_counts')

map.connect('/api/2/rest', controller='rest2', action='index')

map.connect('/api/2/rest/package', controller='apiv2/package', action='list',
map.connect('/api/2/util/user/autocomplete', controller='api',
action='user_autocomplete')
map.connect('/api/2/util/package/create_slug', controller='api', action='create_slug',
conditions=dict(method=['GET']))
map.connect('/api/2/util/package/create_slug', controller='apiv2/package', action='create_slug',
map.connect('/api/2/util/tag/autocomplete', controller='api', action='tag_autocomplete',
conditions=dict(method=['GET']))
map.connect('/api/2/util/tag/autocomplete', controller='apiv2/package', action='autocomplete',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/package', controller='apiv2/package', action='create',
conditions=dict(method=['POST']))
map.connect('/api/2/rest/package/:id', controller='apiv2/package', action='show',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/package/:id', controller='apiv2/package', action='update',
conditions=dict(method=['POST']))
map.connect('/api/2/rest/package/:id', controller='apiv2/package', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/2/rest/package/:id', controller='apiv2/package', action='delete',
conditions=dict(method=['DELETE']))

map.connect('/api/2/rest/:register', controller='rest2', action='list',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/:register', controller='rest2', action='create',
conditions=dict(method=['POST']))
map.connect('/api/2/rest/:register/:id', controller='rest2', action='show',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/:register/:id', controller='rest2', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/2/rest/:register/:id', controller='rest2', action='update',
conditions=dict(method=['POST']))
map.connect('/api/2/rest/:register/:id', controller='rest2', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/2/rest/:register/:id/:subregister',
controller='rest2', action='list',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/:register/:id/:subregister/:id2',
controller='rest2', action='create',
conditions=dict(method=['POST']))
map.connect('/api/2/rest/:register/:id/:subregister/:id2',
controller='rest2', action='show',
conditions=dict(method=['GET']))
map.connect('/api/2/rest/:register/:id/:subregister/:id2',
controller='rest2', action='update',
conditions=dict(method=['PUT']))
map.connect('/api/2/rest/:register/:id/:subregister/:id2',
controller='rest2', action='delete',
conditions=dict(method=['DELETE']))
map.connect('/api/2/qos/throughput/',
controller='rest', action='throughput',
conditions=dict(method=['GET']))
map.connect('/api/2/util/authorizationgroup/autocomplete', controller='api',
action='authorizationgroup_autocomplete')






map.connect('/api/2/util/user/autocomplete', controller='apiv2/user',
action='autocomplete')

###########
## /END API
Expand Down Expand Up @@ -242,14 +162,16 @@ def make_map():
map.connect('/tag/:id', controller='tag', action='read')
map.redirect("/users/{url:.*}", "/user/{url}")
map.connect('/user/edit', controller='user', action='edit')
map.connect('/user/edit/:id', controller='user', action='edit')
# Note: openid users have slashes in their ids, so need the wildcard
# in the route.
map.connect('/user/edit/{id:.*}', controller='user', action='edit')
map.connect('/user/register', controller='user', action='register')
map.connect('/user/login', controller='user', action='login')
map.connect('/user/logged_in', controller='user', action='logged_in')
map.connect('/user/logged_out', controller='user', action='logged_out')
map.connect('/user/apikey', controller='user', action='apikey')
map.connect('/user/me', controller='user', action='me')
map.connect('/user/:id', controller='user', action='read')
map.connect('/user/{id:.*}', controller='user', action='read')
map.connect('/{controller}', action='index')
map.connect('/:controller/{action}')
map.connect('/{controller}/{action}/{id}')
Expand Down
Loading

0 comments on commit 4744e66

Please sign in to comment.