migration for left side-bar

This commit is contained in:
Sanj 2012-02-26 05:58:22 +05:30
parent ca15430389
commit dd48490687

View File

@ -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)