コード例 #1
0
ファイル: views.py プロジェクト: yagrossman/Sefaria-Project
def reset_counts(request, title=None):
    if title:
        i  = model.get_index(title)
        vs = model.VersionState(index=i)
        vs.refresh()
        return HttpResponseRedirect("/%s?m=Counts-Rebuilt" % model.Ref(i.title).url())
    else:
        model.refresh_all_states()
        return HttpResponseRedirect("/?m=Counts-Rebuilt")
コード例 #2
0
ファイル: views.py プロジェクト: zoejf/Sefaria-Project
def reset_counts(request, title=None):
    if title:
        try:
            i = model.library.get_index(title)
        except:
            return HttpResponseRedirect("/dashboard?m=Unknown-Book")
        vs = model.VersionState(index=i)
        vs.refresh()
        return HttpResponseRedirect("/%s?m=Counts-Rebuilt" % model.Ref(i.title).url())
    else:
        model.refresh_all_states()
        return HttpResponseRedirect("/?m=Counts-Rebuilt")
コード例 #3
0
ファイル: views.py プロジェクト: emilyaviva/Sefaria-Project
def reset_counts(request, title=None):
    if title:
        try:
            i = model.library.get_index(title)
        except:
            return HttpResponseRedirect("/dashboard?m=Unknown-Book")
        vs = model.VersionState(index=i)
        vs.refresh()

        return HttpResponseRedirect("/%s?m=Counts-Rebuilt" % model.Ref(i.title).url())
    else:
        model.refresh_all_states()

        if MULTISERVER_ENABLED:
            server_coordinator.publish_event("library", "rebuild_toc")

        return HttpResponseRedirect("/?m=Counts-Rebuilt")
コード例 #4
0
ファイル: views.py プロジェクト: nakee/Sefaria-Project
def rebuild_counts_and_toc(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-&-TOC-Rebuilt")
コード例 #5
0
ファイル: views.py プロジェクト: nakee/Sefaria-Project
def reset_counts(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-Rebuilt")
コード例 #6
0
ファイル: views.py プロジェクト: Elisha4700/Sefaria-Project
def rebuild_counts_and_toc(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-&-TOC-Rebuilt")
コード例 #7
0
ファイル: views.py プロジェクト: Elisha4700/Sefaria-Project
def reset_counts(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-Rebuilt")
コード例 #8
0
anaBekhoach = model.Index().load({'title': 'Ana BeKhoach'})
anaBekhoach.categories = [u'Liturgy',u'Piyutim'] #why doesn't update() work on an instance?
anaBekhoach.save()

model.IndexSet({"title":{"$regex": "Rabbah?"}}).update({"categories": ['Midrash', 'Aggadic Midrash', 'Midrash Rabbah']})
#this one should not have been updated.
model.Index().update({'title': 'Tanna Debei Eliyahu Rabbah'}, {'categories': ['Midrash', 'Aggadic Midrash']})

model.IndexSet({'title': {"$regex" : 'Ein Yaakov'}}).update({'categories': ['Midrash', 'Aggadic Midrash']})

model.Index().update({'title': 'Midrash Tanchuma'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Legends of the Jews'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Midrash Mishlei'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Pirkei Derabi Eliezer'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Midrash on Proverbs'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': "Midrash B'not Zelophehad"}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Midrash Tehilim'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Pesikta de rav kahana'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'The Fathers according to Rabbi Nathan'}, {'categories': ['Midrash', 'Aggadic Midrash']})
model.Index().update({'title': 'Yalkut Shimoni'}, {'categories': ['Midrash', 'Aggadic Midrash']})


model.Index().update({'title': 'Sifra'}, {'categories': ['Midrash', 'Halachic Midrash']})
model.Index().update({'title': "Mekhilta d'Rabbi Yishmael"}, {'categories': ['Midrash', 'Halachic Midrash']})
model.Index().update({'title': 'Mekhilta'}, {'categories': ['Midrash', 'Halachic Midrash']})
model.Index().update({'title': 'Sifre Bamidbar'}, {'categories': ['Midrash', 'Halachic Midrash']})


# Rebuild counts docs, so they get the allVersionCounts field
model.refresh_all_states()