From 7b48201969265f1e69956dcd218928e1695b4e03 Mon Sep 17 00:00:00 2001 From: saengel Date: Sun, 29 Oct 2023 15:21:44 +0200 Subject: [PATCH] chore(MEY Second Appendix): Script to add a second appendix to MEY on Megillah --- .../add_mey_second_appendix.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/Content_Quality/add_mey_second_appendix.py diff --git a/sources/Content_Quality/add_mey_second_appendix.py b/sources/Content_Quality/add_mey_second_appendix.py new file mode 100644 index 0000000000..3a151c5f2a --- /dev/null +++ b/sources/Content_Quality/add_mey_second_appendix.py @@ -0,0 +1,25 @@ +import django + +django.setup() + +from sefaria.model import * +from sefaria.helper.schema import attach_branch + +# Load the Mishnat Eretz Yisrael on Mishnah Megillah index / parent node +mey_idx = Index().load({'title': 'Mishnat Eretz Yisrael on Mishnah Megillah'}) +parent_node_mey = mey_idx.nodes + +# Create new node for "Appendix 2" +new_node = JaggedArrayNode() +new_node.key = "Appendix 2" +new_node.add_structure(["Paragraph"]) +new_node.add_primary_titles(en_title="Appendix 2", he_title="נספח ב") +new_node.validate() + +# Add new node to correct position +attach_branch(new_node=new_node, parent_node=parent_node_mey, place=3) + +# Confirm via reload +mey_idx = Index().load({'title': 'Mishnat Eretz Yisrael on Mishnah Megillah'}) +print(mey_idx.nodes.children) +