summaryrefslogtreecommitdiff
path: root/papillon/poll_cleaning.py
diff options
context:
space:
mode:
authoretienne2010-03-27 17:06:03 +0000
committeretienne2010-03-27 17:06:03 +0000
commit95729368a48257b110ea33dfb005785f8ed6734f (patch)
tree8b99b375a4b4a2e121a9192910af15485ea2b7c3 /papillon/poll_cleaning.py
parent8ded76ae513b38d14773449e46543b54cf48ef49 (diff)
Rearrange directories - include documentation
Diffstat (limited to 'papillon/poll_cleaning.py')
-rwxr-xr-xpapillon/poll_cleaning.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/papillon/poll_cleaning.py b/papillon/poll_cleaning.py
new file mode 100755
index 0000000..993a5b4
--- /dev/null
+++ b/papillon/poll_cleaning.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+'''
+Clean the old polls
+'''
+
+import os
+import sys
+
+# django settings path
+os.environ['DJANGO_SETTINGS_MODULE'] = 'papillon.settings'
+
+# add the parent path to sys.path
+curdir = os.path.abspath(os.curdir)
+sep = os.path.sep
+sys.path.append(sep.join(curdir.split(sep)[:-1]))
+
+
+from papillon.polls.models import Poll
+
+for poll in Poll.objects.all():
+ poll.checkForErasement()