Exemplo n.º 1
0
# 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")
subscribe(link.process_index_delete_in_links,                           text.Index, "delete")
subscribe(note.process_index_delete_in_notes,                           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")
subscribe(text.process_index_delete_in_toc,                             text.Index, "delete")
subscribe(cascade_delete(notification.GlobalNotificationSet, "content.index", "title"),   text.Index, "delete")

Exemplo n.º 2
0
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")
subscribe(scache.process_new_commentary_version_in_cache,               text.Version, "create")

# Note Delete
subscribe(layer.process_note_deletion_in_layer,                         note.Note, "delete")

# Term name change
subscribe(cascade(schema.TermSet, "scheme"),                            schema.TermScheme, "attributeChange", "name")

# Version State Save
subscribe(translation_request.process_version_state_change_in_translation_requests, version_state.VersionState, "save")

# Time
subscribe(cascade(person.PersonSet, "era"),                              time.TimePeriod, "attributeChange", "symbol")
subscribe(cascade(person.PersonSet, "generation"),                       time.TimePeriod, "attributeChange", "symbol")

# Person key change
subscribe(cascade(person.PersonRelationshipSet, "to_key"),               person.Person, "attributeChange", "key")
subscribe(cascade(person.PersonRelationshipSet, "from_key"),             person.Person, "attributeChange", "key")
subscribe(cascade_to_list(text.IndexSet, "authors"),                     person.Person, "attributeChange", "key")

subscribe(cascade(person.PersonRelationshipSet, "type"),                 person.PersonRelationshipType, "attributeChange", "key")
Exemplo n.º 3
0
# 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")

# Note Delete
subscribe(layer.process_note_deletion_in_layer, note.Note, "delete")

# Term name change
subscribe(cascade(schema.TermSet, "scheme"), schema.TermScheme,
          "attributeChange", "name")

# Version Save
subscribe(
    translation_request.process_version_state_change_in_translation_requests,
    version_state.VersionState, "save")

# todo: notes? reviews?
# todo: Scheme name change in Index
# todo: term change in nodes


# These are defined here because of import-loop wonkiness
def process_index_delete_in_summaries(index, **kwargs):
    import sefaria.summaries as summaries
Exemplo n.º 4
0
# 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")
subscribe(link.process_index_delete_in_links, text.Index, "delete")
subscribe(note.process_index_delete_in_notes, 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")
subscribe(text.process_index_delete_in_toc, text.Index, "delete")
subscribe(
Exemplo n.º 5
0
    index_full_version(search_index_name_merged, text_index, kwargs.get("new"), ver.language)


# Version Title Change
subscribe(text.process_commentary_version_title_change_in_cache,        text.Version, "attributeChange", "title")
subscribe(history.process_version_title_change_in_history,              text.Version, "attributeChange", "versionTitle")
subscribe(process_version_title_change_in_search,                       text.Version, "attributeChange", "versionTitle")

subscribe(text.process_version_save_in_cache,                           text.Version, "save")
subscribe(text.process_version_delete_in_cache,                         text.Version, "delete")

# Note Delete
subscribe(layer.process_note_deletion_in_layer,                         note.Note, "delete")

# Term name change
subscribe(cascade(schema.TermSet, "scheme"),                            schema.TermScheme, "attributeChange", "name")

# Version State Save
subscribe(translation_request.process_version_state_change_in_translation_requests, version_state.VersionState, "save")

# Time
subscribe(cascade(person.PersonSet, "era"),                                time.TimePeriod, "attributeChange", "symbol")
subscribe(cascade(person.PersonSet, "generation"),                         time.TimePeriod, "attributeChange", "symbol")

# Person key change
subscribe(cascade(person.PersonRelationshipSet, "to_key"),                 person.Person, "attributeChange", "key")
subscribe(cascade(person.PersonRelationshipSet, "from_key"),               person.Person, "attributeChange", "key")
subscribe(cascade_to_list(text.IndexSet, "authors"),                       person.Person, "attributeChange", "key")

subscribe(cascade(person.PersonRelationshipSet, "type"),                   person.PersonRelationshipType, "attributeChange", "key")
Exemplo n.º 6
0
# 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")

# Note Delete
subscribe(layer.process_note_deletion_in_layer,                         note.Note, "delete")

# Term name change
subscribe(cascade(schema.TermSet, "scheme"),                              schema.TermScheme, "attributeChange", "name")

# Version Save
subscribe(translation_request.process_version_state_change_in_translation_requests, version_state.VersionState, "save")

# todo: notes? reviews?
# todo: Scheme name change in Index
# todo: term change in nodes


# These are defined here because of import-loop wonkiness
def process_index_delete_in_summaries(index, **kwargs):
    import sefaria.summaries as summaries
    if index.is_commentary():
        #deleting a commentary might cause a big shift in the ToC, so just rebuild for now.
        summaries.update_table_of_contents()
Exemplo n.º 7
0
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")

# Note Delete
subscribe(layer.process_note_deletion_in_layer,                         note.Note, "delete")

# Term name change
subscribe(cascade(text.TermSet, "scheme"),                              text.TermScheme, "attributeChange", "name")
subscribe(cascade(text.TermSet, "scheme"),                              text.TermScheme, "attributeChange", "name")

# Version Save
subscribe(translation_request.process_version_state_change_in_translation_requests, version_state.VersionState, "save")

# todo: notes? reviews?
# todo: Scheme name change in Index
# todo: term change in nodes


# These are defined here because of import-loop wonkiness
def process_index_delete_in_summaries(index, **kwargs):
    import sefaria.summaries as summaries
    if index.is_commentary():
        #deleting a commentary might cause a big shift in the ToC, so just rebuild for now.
Exemplo n.º 8
0
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")
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")
subscribe(scache.process_new_commentary_version_in_cache,               text.Version, "create")

# Note Delete
subscribe(layer.process_note_deletion_in_layer,                         note.Note, "delete")

# Term name change
subscribe(cascade(schema.TermSet, "scheme"),                              schema.TermScheme, "attributeChange", "name")

# Version Save
subscribe(translation_request.process_version_state_change_in_translation_requests, version_state.VersionState, "save")

# todo: notes? reviews?
# todo: Scheme name change in Index
# todo: term change in nodes


# These are defined here because of import-loop wonkiness
def process_index_delete_in_summaries(index, **kwargs):
    import sefaria.summaries as summaries
    if index.is_commentary():
        #deleting a commentary might cause a big shift in the ToC, so just rebuild for now.
        summaries.update_table_of_contents()