adhocracy_core.evolution package¶
Scripts to migrate legacy objects in existing databases.
-
migrate_to_attribute_storage(context: <InterfaceClass adhocracy_core.sheets.pool.IPool>, isheet: <InterfaceClass zope.interface.interfaces.IInterface>)[source]¶ Migrate sheet data for`isheet` from annotation to attribute storage.
-
migrate_new_sheet(context: <InterfaceClass adhocracy_core.sheets.pool.IPool>, iresource: <InterfaceClass zope.interface.interfaces.IInterface>, isheet: <InterfaceClass zope.interface.interfaces.IInterface>, isheet_old: <InterfaceClass zope.interface.interfaces.IInterface>=None, remove_isheet_old=False, fields_mapping: [(<class 'str'>, <class 'str'>)]=[])[source]¶ Add new isheet to iresource resources and migrate field values.
Parameters: - context – Pool to search for iresource resources
- iresource – resource type to migrate
- isheet – new sheet interface to add
- isheet_old – old sheet interface to migrate, must not be None if fields_mapping or remove_isheet_old is set.
- remove_isheet_old (
bool) – remove old sheet interface - fields_mapping – list of (field name, old field name) to migrate field values.
-
migrate_new_iresource(context: <InterfaceClass adhocracy_core.interfaces.IResource>, old_iresource: <InterfaceClass zope.interface.interfaces.IInterface>, new_iresource: <InterfaceClass zope.interface.interfaces.IInterface>)[source]¶ Migrate resources with old_iresource interface to new_iresource.
-
log_migration(func)[source]¶ Decorator for the migration scripts.
The decorator logs the call to the evolve script.
-
evolve1_add_title_sheet_to_pools(root: <InterfaceClass adhocracy_core.sheets.pool.IPool>, registry: pyramid.registry.Registry)[source]¶ Add title sheet to basic pools and asset pools.
-
make_proposals_badgeable(root, registry)[source]¶ Add badge services processes and make proposals badgeable.
-
lower_case_users_emails(root, registry)[source]¶ Lower case users email, add ‘private_user_email’/’user_name’ index.
-
remove_name_sheet_from_items(root, registry)[source]¶ Remove name sheet from items and items subtypes.
-
add_workflow_assignment_sheet_to_pools_simples(root, registry)[source]¶ Add generic workflow sheet to pools and simples.
-
make_proposalversions_polarizable(root, registry)[source]¶ Make proposals polarizable and add relations pool.
-
migrate_rate_sheet_to_attribute_storage(root, registry)[source]¶ Migrate rate sheet to attribute storage.
-
move_autoname_last_counters_to_attributes(root, registry)[source]¶ Move autoname last counters of pools to attributes.
Remove _autoname_lasts attribute. Instead add private attributes to store autoname last counter objects. Cleanup needless counter objects.
-
move_sheet_annotation_data_to_attributes(root, registry)[source]¶ Move sheet annotation data to resource attributes.
Remove _sheets dictionary to store sheets data annotations. Instead add private attributes for every sheet data annotation to resource.
-
add_image_reference_to_users(root, registry)[source]¶ Add image reference to users and add assets service to users service.
-
update_asset_download_children(root, registry)[source]¶ Add asset downloads and update IAssetMetadata sheet.
-
recreate_all_image_size_downloads(root, registry)[source]¶ Recreate all image size downloads to optimize file size.
-
remove_tag_resources(root, registry)[source]¶ Remove all ITag resources, create ITags sheet references instead.
-
add_description_sheet_to_organisations(root, registry)[source]¶ Add description sheet to organisations.
-
add_image_reference_to_organisations(root, registry)[source]¶ Add image reference to organisations and add assets service.
-
remove_is_service_attribute(root, registry)[source]¶ Remove __is_service__ attribute, use IService interface instead.
-
allow_create_asset_for_users(root, registry)[source]¶ Allow all users to create_assets inside the users service.
-
update_workflow_state_acl_for_all_resources(root, registry)[source]¶ Update the local acl with the current workflow state acl.
-
remove_token_storage(root, registry)[source]¶ Remove storage for authentication tokens, not used anymore.
-
set_default_workflow(root, registry)[source]¶ Set default workflow if no workflow in IWorkflowAssignment sheet.
-
add_local_roles_for_workflow_state(root, registry)[source]¶ Add local role of the current workflow state for all processes.
-
migrate_auditlogentries_to_activities(root, registry)[source]¶ Replace AuditlogenEntries with Activities entries.
-
allow_image_download_view_for_everyone(root, registry)[source]¶ Add acls to image downloads to allow view for everyone.
-
remove_participant_role_from_default_group(root, registry)[source]¶ Remove global participant role from default group.
-
add_activation_config_sheet_to_user(root, registry)[source]¶ Add acitvation configuration sheet to user.
-
add_allow_add_anonymized_sheet_to_process(root, registry)[source]¶ Add allow add anonymized sheet to process.
-
add_allow_add_anonymized_sheet_to_comments(root, registry)[source]¶ Add allow add anonymized sheet to comments service.
-
add_allow_add_anonymized_sheet_to_items(root, registry)[source]¶ Add allow add anonymized sheet to items.
-
add_allow_add_anonymized_sheet_to_rates(root, registry)[source]¶ Add allow add anonymized sheet to rates service.
-
add_local_roles_to_acl(root, registry)[source]¶ Add ACE based on local roles to acl (process/organisation, proposal).