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.

add_kiezkassen_permissions(root)[source]

(disabled) Add permission to use the kiezkassen process.

upgrade_catalogs(root, registry)[source]

Upgrade catalogs.

make_users_badgeable(root, registry)[source]

Add badge services and make user badgeable.

make_proposals_badgeable(root, registry)[source]

Add badge services processes and make proposals badgeable.

change_pools_autonaming_scheme(root, registry)[source]

Change pool autonaming scheme.

hide_password_resets(root, registry)[source]

Add hide all password reset objects.

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.

add_icanpolarize_sheet_to_comments(root, registry)[source]

Make comments ICanPolarize.

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.

remove_empty_first_versions(root, registry)[source]

Outdated.

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.

reindex_interfaces_catalog_for_root(root, registry)[source]

Reindex ‘interfaces’ catalog for root.

add_description_sheet_to_organisations(root, registry)[source]

Add description sheet to organisations.

add_description_sheet_to_processes(root, registry)[source]

Add description sheet to processes.

add_image_reference_to_organisations(root, registry)[source]

Add image reference to organisations and add assets service.

set_comment_count(root, registry)[source]

Outdated.

remove_duplicated_group_ids(root, registry)[source]

Remove duplicate group_ids from users.

add_image_reference_to_proposals(root, registry)[source]

Add description sheet to proposals.

reset_comment_count(root, registry)[source]

Outdated.

remove_is_service_attribute(root, registry)[source]

Remove __is_service__ attribute, use IService interface instead.

add_canbadge_sheet_to_users(root, registry)[source]

Add canbadge sheet to users.

enable_order_for_organisation(root, registry)[source]

Enable children order for organisations.

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.

add_controversiality_index(root, registry)[source]

Add controversity index.

add_description_sheet_to_user(root, registry)[source]

Add description sheet to user.

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.

rename_default_group(root, registry)[source]

Rename default user group.

migrate_auditlogentries_to_activities(root, registry)[source]

Replace AuditlogenEntries with Activities entries.

add_notification_sheet_to_user(root, registry)[source]

Add notification sheet to user.

add_followable_sheet_to_process(root, registry)[source]

Add followable sheet to process.

remove_comment_count_data(root, registry)[source]

Remove comment_count data in ICommentable sheet.

reindex_comments(root, registry)[source]

Update comments index.

add_localroles_sheet_to_pools(root, registry)[source]

Add localroles sheet to user.

allow_image_download_view_for_everyone(root, registry)[source]

Add acls to image downloads to allow view for everyone.

add_followable_sheet_to_organisation(root, registry)[source]

Add followable sheet to orgnisations.

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_global_anonymous_user(root, registry)[source]

Add global anonymmous 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_anonymize_default_sheet_to_user(root, registry)[source]

Add anonymize default sheet to user.

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).

add_pages_service_to_root(root, registry)[source]

Add pages service to root.

add_embed_sheet_to_processes(root, registry)[source]

Add embed to processes.

reindex_users_text(root, registry)[source]

Reindex user system text index.

add_email_new_sheet_to_user(root, registry)[source]

Add email new sheet to user.

add_activity_service_to_root(root, registry)[source]

Add activity service to root.

add_service_konto_sheet_to_user(root, registry)[source]

Add ServiceKonto sheet to user.

add_service_konto_settings_sheet_to_user(root, registry)[source]

Add ServiceKonto settings sheet to user.

includeme(config)[source]

Register evolution utilities and add evolution steps.