""" dependencies.py -- list cross model dependencies and subscribe listeners to changes. """ from . import abstract, link, note, history, schema, text, layer, version_state, translation_request, timeperiod, person, garden, notification, group, library, category from abstract import subscribe, cascade, cascade_to_list, cascade_delete, cascade_delete_to_list import sefaria.system.cache as scache # Index Save / Create subscribe(text.process_index_change_in_core_cache, text.Index, "save") subscribe(version_state.create_version_state_on_index_creation, text.Index, "save") subscribe(text.process_index_change_in_toc, text.Index, "save") # Index Name Change subscribe(text.process_index_title_change_in_core_cache, text.Index, "attributeChange", "title") subscribe(link.process_index_title_change_in_links, text.Index, "attributeChange", "title") subscribe(note.process_index_title_change_in_notes, text.Index, "attributeChange", "title") subscribe(history.process_index_title_change_in_history, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_versions, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_dependant_records, text.Index, "attributeChange", "title") subscribe(version_state.process_index_title_change_in_version_state, text.Index, "attributeChange", "title") subscribe(cascade(notification.GlobalNotificationSet, "content.index"), text.Index, "attributeChange", "title") # Taken care of on save # subscribe(text.process_index_change_in_toc, text.Index, "attributeChange", "title") # Index Delete (start with cache clearing) subscribe(text.process_index_delete_in_core_cache, text.Index, "delete") subscribe(version_state.process_index_delete_in_version_state, text.Index, "delete")
""" dependencies.py -- list cross model dependencies and subscribe listeners to changes. """ from . import abstract, link, note, history, schema, text, layer, version_state, translation_request from abstract import subscribe, cascade import sefaria.system.cache as scache # Index Save / Create subscribe(scache.process_index_change_in_cache, text.Index, "save") subscribe(version_state.create_version_state_on_index_creation, text.Index, "create") # Index Name Change (start with cache clearing) subscribe(scache.process_index_change_in_cache, text.Index, "attributeChange", "title") subscribe(link.process_index_title_change_in_links, text.Index, "attributeChange", "title") subscribe(note.process_index_title_change_in_notes, text.Index, "attributeChange", "title") subscribe(history.process_index_title_change_in_history, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_versions, text.Index, "attributeChange", "title") subscribe(version_state.process_index_title_change_in_version_state, text.Index, "attributeChange", "title") # Index Delete (start with cache clearing) subscribe(scache.process_index_change_in_cache, text.Index, "delete") subscribe(version_state.process_index_delete_in_version_state, text.Index,
""" dependencies.py -- list cross model dependencies and subscribe listeners to changes. """ from . import abstract, link, note, history, schema, text, layer, version_state, translation_request, time, person, garden from abstract import subscribe, cascade, cascade_to_list, cascade_delete, cascade_delete_to_list import sefaria.system.cache as scache # Index Save / Create subscribe(text.process_index_change_in_core_cache, text.Index, "save") subscribe(version_state.create_version_state_on_index_creation, text.Index, "save") subscribe(text.process_index_change_in_toc, text.Index, "save") # Index Name Change subscribe(text.process_index_title_change_in_core_cache, text.Index, "attributeChange", "title") subscribe(link.process_index_title_change_in_links, text.Index, "attributeChange", "title") subscribe(note.process_index_title_change_in_notes, text.Index, "attributeChange", "title") subscribe(history.process_index_title_change_in_history, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_versions, text.Index, "attributeChange", "title") subscribe(version_state.process_index_title_change_in_version_state, text.Index, "attributeChange", "title") # Taken care of on save # subscribe(text.process_index_change_in_toc, text.Index, "attributeChange", "title")
""" dependencies.py -- list cross model dependencies and subscribe listeners to changes. """ from . import abstract, link, note, history, schema, text, layer, version_state, translation_request, time, person, garden from abstract import subscribe, cascade, cascade_to_list, cascade_delete, cascade_delete_to_list import sefaria.system.cache as scache # Index Save / Create subscribe(scache.process_index_change_in_cache, text.Index, "save") subscribe(version_state.create_version_state_on_index_creation, text.Index, "create") # Index Name Change (start with cache clearing) subscribe(scache.process_index_change_in_cache, text.Index, "attributeChange", "title") subscribe(link.process_index_title_change_in_links, text.Index, "attributeChange", "title") subscribe(note.process_index_title_change_in_notes, text.Index, "attributeChange", "title") subscribe(history.process_index_title_change_in_history, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_versions, text.Index, "attributeChange", "title") subscribe(version_state.process_index_title_change_in_version_state, text.Index, "attributeChange", "title") # Index Delete (start with cache clearing) subscribe(scache.process_index_delete_in_cache, text.Index, "delete") subscribe(version_state.process_index_delete_in_version_state, text.Index, "delete") subscribe(link.process_index_delete_in_links, text.Index, "delete") subscribe(text.process_index_delete_in_versions, text.Index, "delete") subscribe(translation_request.process_index_delete_in_translation_requests, text.Index, "delete") # Version Title Change subscribe(history.process_version_title_change_in_history, text.Version, "attributeChange", "versionTitle")
""" dependencies.py -- list cross model dependencies and subscribe listeners to changes. """ from . import abstract, link, note, history, schema, text, layer, version_state, translation_request from abstract import subscribe, cascade import sefaria.system.cache as scache # Index Save / Create subscribe(scache.process_index_change_in_cache, text.Index, "save") subscribe(version_state.create_version_state_on_index_creation, text.Index, "create") # Index Name Change (start with cache clearing) subscribe(scache.process_index_change_in_cache, text.Index, "attributeChange", "title") subscribe(link.process_index_title_change_in_links, text.Index, "attributeChange", "title") subscribe(note.process_index_title_change_in_notes, text.Index, "attributeChange", "title") subscribe(history.process_index_title_change_in_history, text.Index, "attributeChange", "title") subscribe(text.process_index_title_change_in_versions, text.Index, "attributeChange", "title") subscribe(version_state.process_index_title_change_in_version_state, text.Index, "attributeChange", "title") # Index Delete (start with cache clearing) subscribe(scache.process_index_change_in_cache, text.Index, "delete") subscribe(version_state.process_index_delete_in_version_state, text.Index, "delete") subscribe(link.process_index_delete_in_links, text.Index, "delete") subscribe(text.process_index_delete_in_versions, text.Index, "delete") # Version Title Change subscribe(history.process_version_title_change_in_history, text.Version, "attributeChange", "versionTitle") subscribe(scache.process_new_commentary_version_in_cache, text.Version, "create")