note about silliness of putting links into this model
authorJeff Hammel <jhammel@mozilla.com>
Thu, 20 May 2010 16:02:01 -0700
changeset 31 e3c4ffacc954dca373c72ccd25ae77751c6d21d9
parent 30 b09d1edc0583a44fb24049a1bafa41a33dbddac7
child 32 0a5545850e57497cbeb9a062d34365fc866ba7e6
push id5
push userjhammel@mozilla.com
push dateFri, 21 May 2010 00:42:10 +0000
note about silliness of putting links into this model
topfails/viewer/models.py
--- a/topfails/viewer/models.py
+++ b/topfails/viewer/models.py
@@ -3,16 +3,20 @@ topfails models using the django ORM
 """
 
 import re
 from django.db import models, connection
 from datetime import datetime
 from time import ctime, sleep, time
 from topfails.mappings import OS_CHOICES
 
+
+# TODO: remove this strange mappings and put what we actually want
+# in mappings.py;  this also goes for the code in datascraper
+
 class BuildStatus():
   Success = 0
   TestFailed = 1
   Burning = 2
   Exception = 3
   Unknown = 4
 
 BUILDSTATUS_CHOICES = (
@@ -39,16 +43,18 @@ class Build(models.Model):
     status = models.IntegerField(choices=BUILDSTATUS_CHOICES)
     changeset = models.CharField(max_length=80,blank=True)
     logfile = models.CharField(max_length=300,blank=True)
     
     def startdate(self):
         return datetime.fromtimestamp(self.starttime)
     
     def changesetlink(self):
+      # TODO: links should not live in the model;  that completely
+      # violates the principle of MVC!
       if str(self.tree)  == 'Firefox':
         return '<a href="%s/rev/%s">%s</a>' % ("http://hg.mozilla.org/mozilla-central", self.changeset, self.changeset)
       elif str(self.tree) == 'Firefox3.6':
         return '<a href="%s/rev/%s">%s</a>' % ("http://hg.mozilla.org/releases/mozilla-1.9.2", self.changeset, self.changeset)
       elif str(self.tree) == 'Thunderbird' or str(self.tree) == 'SeaMonkey':  
         return '<a href="%s/rev/%s">%s</a>' % ("http://hg.mozilla.org/comm-central", self.changeset, self.changeset)
       else :
         return '<a href="%s/rev/%s">%s</a>' % ("http://hg.mozilla.org/mozilla-central", self.changeset, self.changeset)