[Python-checkins] r88763 - tracker/instances/python-dev/scripts/updatecc

martin.v.loewis python-checkins at python.org
Mon Mar 7 09:59:16 CET 2011


Author: martin.v.loewis
Date: Mon Mar  7 09:59:16 2011
New Revision: 88763

Log:
Add script to fill out issue CC.


Added:
   tracker/instances/python-dev/scripts/updatecc   (contents, props changed)

Added: tracker/instances/python-dev/scripts/updatecc
==============================================================================
--- (empty file)
+++ tracker/instances/python-dev/scripts/updatecc	Mon Mar  7 09:59:16 2011
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+import sys, os, urllib2, logging, datetime
+basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.append(basedir+"/rietveld")
+os.environ["DJANGO_SETTINGS_MODULE"]="settings"
+import gae2django
+gae2django.install(server_software='Django')
+
+from codereview.models import (Repository, Branch, Patch, 
+                               PatchSet, Issue, Content)
+from django.db import connection, transaction
+c = connection.cursor()
+
+for issue in Issue.objects.all():
+    c.execute("select _address from _user,issue_nosy where nodeid=%s and id=linkid",
+              (issue.id,))
+    issue.cc = [r[0] for r in c.fetchall()]
+    issue.save()


More information about the Python-checkins mailing list