[ckan-changes] [ckan/ckan] c39672: Remove statefulness from package extras

David Read noreply at github.com
Fri Mar 15 16:49:25 UTC 2019


  Branch: refs/heads/integrate-vdm-stateful
  Home:   https://github.com/ckan/ckan
  Commit: c39672cad0975c2ab0177744edc863b57f0c2dd0
      https://github.com/ckan/ckan/commit/c39672cad0975c2ab0177744edc863b57f0c2dd0
  Author: David Read <david.read at hackneyworkshop.com>
  Date:   2019-03-15 (Fri, 15 Mar 2019)

  Changed paths:
    M ckan/lib/dictization/model_save.py
    M ckan/model/package_extra.py
    M ckan/model/resource.py
    M ckan/tests/legacy/models/test_extras.py

  Log Message:
  -----------
  Remove statefulness from package extras

* This is part of getting rid of vdm.
* We don't need to store state in PackageExtra any more because you can view the history via activity stream, since it now stores the full package_dict #3972. (The package_extra_revision table will be used to migrate old versions of the package to activity_streams migrate_package_activity.py. But from this version of CKAN, we do not need to record PackageExtra.stateit any more.)
* The mapping between PackageExtra and Package is now a simply dict i.e. attribute_mapped_collection - not a vdm StatefulDict any more.
* vdm's OurAssociationProxy is replaced by the vanilla sqlalchemy association_proxy - I'm not clear why we had to prevent scalars being assigned in the first place since it is a dict mapping, not a scalar mapping. Seems ok.
* package_extras_save() no longer needs to add and remove PackageExtra objects carefully changing the state, we can simply replace them with fresh objects.
* package_no_state/extras_list is no longer needed because it was only used by package_extras_save()




More information about the ckan-changes mailing list