From ca15430389507ea5b74cae8176b963eb9f0b5a1c Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 25 Feb 2012 18:03:00 +0530 Subject: [PATCH] add next to pad.ma in migrations --- padmaTexts/migrations/migrate.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/padmaTexts/migrations/migrate.py b/padmaTexts/migrations/migrate.py index 4c538b4..26b1424 100644 --- a/padmaTexts/migrations/migrate.py +++ b/padmaTexts/migrations/migrate.py @@ -47,3 +47,13 @@ def doAll(): p.html = newText p.save() + +def nextToCurrent(text): + return text.replace(NEXT, OLD) + +def nextAll(): + for p in PadmaText.objects.all(): + print p.title + p.html = nextToCurrent(p.html) + p.save() +