コード例 #1
0
ファイル: views.py プロジェクト: emilyaviva/Sefaria-Project
def delete_orphaned_counts(request):
    remove_old_counts()
    scache.delete_template_cache("texts_dashboard")

    if MULTISERVER_ENABLED:
        server_coordinator.publish_event("scache", "delete_template_cache", ["texts_dashboard"])

    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
コード例 #2
0
        version_copy = deepcopy(version)
        version_copy["title"] = "(removed) Shadal on Genesis"
        del version_copy["_id"]
        db.texts.save(version_copy)

        version["chapter"] = version["chapter"][:4]
        db.texts.save(version)

    elif (not version["versionSource"].startswith("http://www.sefaria.org") and
          not version["versionSource"].startswith("http://www.archive.org")):

        titles.add(version["title"])
        version["title"] = "(removed) " + version["title"]
        db.texts.save(version)

links = db.links.find({"refs": {"$regex": "^Shadal on "}})
for link in links:
    parsed = map(parse_ref, link["refs"])
    remove = True
    for p in parsed:
        if (p.get("book", None) == "Shadal on Genesis"
                and p.get("sections", [999])[0] <= 5):
            remove = False
    if remove:
        db.links.remove(link)

for title in list(titles):
    counts.update_text_count(title)

remove_old_counts()
コード例 #3
0
		version["chapter"] = version["chapter"][:4]
		db.texts.save(version)


	elif (not version["versionSource"].startswith("http://www.sefaria.org") and
		not version["versionSource"].startswith("http://www.archive.org")):

		titles.add(version["title"])
		version["title"] = "(removed) " + version["title"] 
		db.texts.save(version)


links = db.links.find({"refs": {"$regex": "^Shadal on "}})
for link in links:
	parsed = map(parse_ref, link["refs"])
	remove = True
	for p in parsed:
		if (p.get("book", None) == "Shadal on Genesis" 
			and p.get("sections", [999])[0] <= 5):
			remove = False
	if remove:
		db.links.remove(link)


for title in list(titles):
	counts.update_full_text_count(title)


remove_old_counts()
コード例 #4
0
ファイル: views.py プロジェクト: zoejf/Sefaria-Project
def delete_orphaned_counts(request):
    remove_old_counts()
    scache.delete_template_cache("texts_dashboard")
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
コード例 #5
0
ファイル: views.py プロジェクト: 2la2/Sefaria-Project
def delete_orphaned_counts(request):
    remove_old_counts()
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
コード例 #6
0
def delete_orphaned_counts(request):
    remove_old_counts()
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")