Permalink
Browse files

add hqscripts app, for one off scripts + a script to clean the couchlog

  • Loading branch information...
1 parent be03188 commit f1ef859eb8ac55cca72dae7c52676d2f1542fc79 @czue czue committed Jun 19, 2011
View
@@ -0,0 +1 @@
+This is an app for (usually single-use) scripts to be run on CommCare HQ
View
No changes.
No changes.
No changes.
@@ -0,0 +1,19 @@
+from django.core.management.base import LabelCommand
+from couchlog.models import ExceptionRecord
+from couchdbkit import Database
+class Command(LabelCommand):
+ """
+ Deletes sofabed cruft from couchlog.
+ """
+ help = "Deletes sofabed cruft from couchlog."
+ args = ""
+ label = ""
+
+ def handle(self, *args, **options):
+ all_matching_records = ExceptionRecord.view("couchlog/all_by_msg",
+ startkey="problem in form listener",
+ endkey="problem in form listenerz",
+ reduce=False).all()
+ for row in all_matching_records:
+ ExceptionRecord.get_db().delete_doc(row["id"])
+
View
@@ -0,0 +1,2 @@
+# This file is only here so that django will recognize that
+# this is a valid app and run the associated unit tests.
View
@@ -113,6 +113,7 @@
'auditcare',
'djangocouch',
'djangocouchuser',
+ 'hqscripts',
'casexml.apps.case',
'casexml.apps.phone',
'corehq.apps.cleanup',

0 comments on commit f1ef859

Please sign in to comment.