diff options
author | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-12-08 22:45:38 +0000 |
---|---|---|
committer | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-12-08 22:45:38 +0000 |
commit | 12d37073df51b099d17d43d3df16bc98ac603efd (patch) | |
tree | 34f3894ed6f24586e219af5273eff2538fa9a401 /poll_cleaning.py | |
parent | a0e093c353140308fc2fac24f1ec179e304ab3ba (diff) | |
download | Papillon-12d37073df51b099d17d43d3df16bc98ac603efd.tar.bz2 Papillon-12d37073df51b099d17d43d3df16bc98ac603efd.zip |
Erase old polls
Diffstat (limited to 'poll_cleaning.py')
-rwxr-xr-x | poll_cleaning.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/poll_cleaning.py b/poll_cleaning.py new file mode 100755 index 0000000..993a5b4 --- /dev/null +++ b/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() |