Beispiel #1
0
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")
Beispiel #2
0
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")
Beispiel #3
0
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")
Beispiel #4
0
def rebuild_counts_and_toc(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-&-TOC-Rebuilt")
Beispiel #5
0
def reset_counts(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-Rebuilt")
Beispiel #6
0
def rebuild_counts_and_toc(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-&-TOC-Rebuilt")
Beispiel #7
0
def reset_counts(request):
    model.refresh_all_states()
    return HttpResponseRedirect("/?m=Counts-Rebuilt")
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()