From dd484906874a584e6f78d073f9a0d52bbe2d98b9 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 26 Feb 2012 05:58:22 +0530 Subject: [PATCH] migration for left side-bar --- padmaTexts/migrations/migrate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/padmaTexts/migrations/migrate.py b/padmaTexts/migrations/migrate.py index 26b1424..6eca655 100644 --- a/padmaTexts/migrations/migrate.py +++ b/padmaTexts/migrations/migrate.py @@ -2,7 +2,7 @@ import urllib2 import re from texts.models import * -NEXT = "http://next.pad.ma/" +NEXT = "http://pad.ma/" OLD = "http://pad.ma/" IdMapping = {} regex = re.compile(r'(http:\/\/.*?pad.ma\/(V.*?))[\s\"\<\n]') @@ -47,6 +47,12 @@ def doAll(): p.html = newText p.save() +def doAllSide(): + for p in PadmaText.objects.all(): + print p.title + newLeftBar = replaceUrls(p.left_bar) + p.left_bar = newLeftBar + p.save() def nextToCurrent(text): return text.replace(NEXT, OLD)