[ckan-dev] Updating A Dataset's Organization

Todd Bleess TBleess at drcog.org
Wed May 7 23:21:33 UTC 2014


Sure thing.

Module ckan.controllers.api:184 in action
<<                  'it needs to be a dictionary.' % request_data)
               try:
                   result = function(context, request_data)
                   return_dict['success'] = True
                   return_dict['result'] = result
>>  result = function(context, request_data)
Module ckan.logic:324 in wrapped
<<                      # c not registered
                           pass
                       return _action(context, data_dict, **kw)
                   return wrapped
>>  return _action(context, data_dict, **kw)
Module ckan.logic.action.update:1047 in package_owner_org_update
<<          else:
                   member_obj.state = 'deleted'
                   member_obj.save()

           # add the organization to memeber table
>>  member_obj.save()
Module ckan.model.domain_object:63 in save
<<      def save(self):
               self.add()
               self.commit()

           def add(self):
>>  self.commit()
Module ckan.model.domain_object:73 in commit
<<      def commit(self):
               self.Session.commit()

           def remove(self):
>>  self.Session.commit()
Module sqlalchemy.orm.scoping:114 in do
<<  def instrument(name):
           def do(self, *args, **kwargs):
               return getattr(self.registry(), name)(*args, **kwargs)
           return do
       for meth in Session.public_methods:
>>  return getattr(self.registry(), name)(*args, **kwargs)
Module sqlalchemy.orm.session:656 in commit
<<                  raise sa_exc.InvalidRequestError("No transaction is begun.")

               self.transaction.commit()

           def prepare(self):
>>  self.transaction.commit()
Module sqlalchemy.orm.session:314 in commit
<<          self._assert_is_open()
               if not self._prepared:
                   self._prepare_impl()

               if self._parent is None or self.nested:
>>  self._prepare_impl()
Module sqlalchemy.orm.session:290 in _prepare_impl
<<          self._assert_is_active()
               if self._parent is None or self.nested:
                   self.session.dispatch.before_commit(self.session)

               stx = self.session.transaction
>>  self.session.dispatch.before_commit(self.session)
Module sqlalchemy.event:291 in __call__
<<              fn(*args, **kw)
               for fn in self.listeners:
                   fn(*args, **kw)

           # I'm not entirely thrilled about the overhead here,
>>  fn(*args, **kw)
Module ckan.model.meta:71 in before_commit
<<      def before_commit(self, session):
               session.flush()
               try:
                   obj_cache = session._object_cache
>>  session.flush()
Module sqlalchemy.orm.session:1583 in flush
<<          try:
                   self._flushing = True
                   self._flush(objects)
               finally:
                   self._flushing = False
>>  self._flush(objects)
Module sqlalchemy.orm.session:1654 in _flush
<<              subtransactions=True)
               try:
                   flush_context.execute()

                   self.dispatch.after_flush(self, flush_context)
>>  flush_context.execute()
Module sqlalchemy.orm.unitofwork:331 in execute
<<                                      self.dependencies,
                                           postsort_actions):
                       rec.execute(self)
>>  rec.execute(self)
Module sqlalchemy.orm.unitofwork:475 in execute
<<          persistence.save_obj(self.mapper,
                   uow.states_for_mapper_hierarchy(self.mapper, False, False),
                   uow
               )
>>  uow
Module sqlalchemy.orm.persistence:45 in save_obj
<<                                                  base_mapper,
                                                       states,
                                                       uowtransaction)

           cached_connections = _cached_connection_dict(base_mapper)
>>  uowtransaction)
Module sqlalchemy.orm.persistence:149 in _organize_states_for_save
<<              mapper.dispatch.before_insert(mapper, connection, state)
               else:
                   mapper.dispatch.before_update(mapper, connection, state)

               # detect if we have a "pending" instance (i.e. has
>>  mapper.dispatch.before_update(mapper, connection, state)
Module sqlalchemy.event:291 in __call__
<<              fn(*args, **kw)
               for fn in self.listeners:
                   fn(*args, **kw)

           # I'm not entirely thrilled about the overhead here,
>>  fn(*args, **kw)
Module sqlalchemy.orm.events:363 in wrap
<<                      return orm.interfaces.EXT_CONTINUE
                       else:
                           return wrapped_fn(*arg, **kw)
                   fn = wrap
>>  return wrapped_fn(*arg, **kw)
Module vdm.sqlalchemy.base:606 in before_update
<<          if not self.revisioning_disabled(instance) and self._is_changed[instance]:
                   logger.debug('before_update: %s' % instance)
                   self.set_revision(instance)
                   self._is_changed[instance] = self.check_real_change(
                       instance, mapper, connection)
>>  self.set_revision(instance)
Module vdm.sqlalchemy.base:532 in set_revision
<<          # set revision to ensure object behaves how it should (e.g. we use
               # instance.revision in after_update)
               assert current_rev, 'No revision is currently set for this Session'
               # We need the revision id unfortunately for this all to work
               # Why? We cannot created new sqlachemy objects in here (as they won't
>>  assert current_rev, 'No revision is currently set for this Session'
AssertionError: No revision is currently set for this Session
CGI Variables

CKAN_CURRENT_URL

'/api/3/action/package_owner_org_update'

CKAN_LANG

'en'

CKAN_LANG_IS_DEFAULT

True

CONTENT_TYPE

'application/x-www-form-urlencoded; charset=utf-8'

DOCUMENT_ROOT

'/etc/apache2/htdocs'

GATEWAY_INTERFACE

'CGI/1.1'

HTTP_ACCEPT_ENCODING

'identity'

HTTP_AUTHORIZATION

'9c683773-930f-414a-a46d-9afef8173143'

HTTP_CONNECTION

'close'

HTTP_HOST

'geodataportalsrv'

HTTP_USER_AGENT

'Python-urllib/2.7'

HTTP_X_FORWARDED_FOR

'10.0.120.79'

HTTP_X_FORWARDED_HOST

'dataportal.drcog.org'

HTTP_X_FORWARDED_SERVER

'dataportal.drcog.org'

PATH_INFO

'/api/3/action/package_owner_org_update'

PATH_TRANSLATED

'/etc/ckan/default/apache.wsgi/api/3/action/package_owner_org_update'

REMOTE_ADDR

'127.0.0.1'

REMOTE_PORT

'56684'

REQUEST_METHOD

'POST'

REQUEST_URI

'/api/3/action/package_owner_org_update'

SCRIPT_FILENAME

'/etc/ckan/default/apache.wsgi'

SERVER_ADDR

'127.0.0.1'

SERVER_ADMIN

'[no address given]'

SERVER_NAME

'geodataportalsrv'

SERVER_PORT

'80'

SERVER_PROTOCOL

'HTTP/1.0'

SERVER_SIGNATURE

'<address>Apache/2.2.22 (Ubuntu) Server at geodataportalsrv Port 80</address>\n'

SERVER_SOFTWARE

'Apache/2.2.22 (Ubuntu)'


WSGI Variables

application

<fanstatic.publisher.Delegator object at 0x7effb6eab1d0>

beaker.cache

<beaker.cache.CacheManager object at 0x7effb6ea7610>

beaker.get_session

<bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7effb6ea7e50>>

beaker.session

{'_accessed_time': 1399385951.107906, '_creation_time': 1399385951.107906}

fanstatic.needed

<fanstatic.core.NeededResources object at 0x7eff9c1e8e10>

mod_wsgi.application_group

'default.ckanhosted.com|'

mod_wsgi.callable_object

'application'

mod_wsgi.handler_script

''

mod_wsgi.input_chunked

'0'

mod_wsgi.listener_host

''

mod_wsgi.listener_port

'8080'

mod_wsgi.process_group

'ckan_default'

mod_wsgi.request_handler

'wsgi-script'

mod_wsgi.script_reloading

'1'

mod_wsgi.version

(3, 3)

paste.cookies

(<SimpleCookie: >, '')

paste.registry

<paste.registry.Registry object at 0x7eff9c1e8450>

paste.throw_errors

True

pylons.action_method

<bound method ApiController.action of <ckan.controllers.api.ApiController object at 0x7effa0107390>>

pylons.controller

<ckan.controllers.api.ApiController object at 0x7effa0107390>

pylons.environ_config

{'session': 'beaker.session', 'cache': 'beaker.cache'}

pylons.pylons

<pylons.util.PylonsContext object at 0x7effa0107510>

pylons.routes_dict

{'action': u'action', 'controller': u'api', 'ver': 3, 'logic_function': u'package_owner_org_update'}

pylons.status_code_redirect

True

repoze.who.logger

<logging.Logger object at 0x7effb6eb5c50>

repoze.who.plugins

{'openid': <OpenIdIdentificationPlugin 139636750637456>, 'friendlyform': <FriendlyFormPlugin 139636750635856>, 'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7effb7209810>, 'auth_tkt': <AuthTktCookiePlugin 139636750635792>, 'ckan.lib.authenticator:OpenIDAuthenticator': <ckan.lib.authenticator.OpenIDAuthenticator object at 0x7effb72097d0>}

routes.route

<routes.route.Route object at 0x7effb6c1e190>

routes.url

<routes.util.URLGenerator object at 0x7effa0107250>

webob._parsed_post_vars

(MultiDict([('{"organization_id": "denver", "id": "bike"}', '')]), <FakeCGIBody at 0x7effa0107c50 viewing MultiDict([('{"...'')])>)

webob._parsed_query_vars

(GET([]), '')

webob.adhoc_attrs

{'errors': 'ignore', 'response': <Response at 0x7eff9c1e8f10 200 OK>, 'language': 'en-us'}

webob.is_body_readable

True

webob.is_body_seekable

False

wsgi process

'Multi process AND threads (?)'

wsgi.file_wrapper

<built-in method file_wrapper of mod_wsgi.Adapter object at 0x7eff8c315c60>

wsgi.version

(1, 1)

wsgiorg.routing_args

(<routes.util.URLGenerator object at 0x7effa0107250>, {'action': u'action', 'controller': u'api', 'ver': 3, 'logic_function': u'package_owner_org_update'})



Todd Bleess | GIS Specialist | Admin & Finance
Direct 303-480-6797 | Fax 303-480-6790 | tbleess at drcog.org<mailto:tbleess at drcog.org>

[cid:image001.gif at 01CF6A18.CAFD7000]<http://www.drcog.org/>

[cid:image002.jpg at 01CF6A18.CAFD7000]<https://mywaytogo.org/#/>
Check out the new MyWaytoGo<https://mywaytogo.org/#/> website for a brand-new look at commuting.
[cid:image003.png at 01CF6A18.CAFD7000]<http://www.facebook.com/Denver.Regional.Council.of.Governments>   [cid:image004.png at 01CF6A18.CAFD7000] <https://twitter.com/DRCOGorg>    [cid:image005.png at 01CF6A18.CAFD7000] <http://www.linkedin.com/company/denver-regional-council-of-governments?trk=cp_followed_name_denver-regional-council-of-governments>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 8239 bytes
Desc: image001.gif
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 4623 bytes
Desc: image002.jpg
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2696 bytes
Desc: image003.png
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1830 bytes
Desc: image004.png
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2770 bytes
Desc: image005.png
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140507/949b5bd6/attachment-0011.png>


More information about the ckan-dev mailing list