diff options
author | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2006-06-20 19:41:24 +0000 |
---|---|---|
committer | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2006-06-20 19:41:24 +0000 |
commit | e55ef35c002f4106a96f52fd0de1d7b13126fcc1 (patch) | |
tree | 87564a26dceff874e5f6c1daffc6314b09445e8a /reports/brpt/reports | |
parent | cabaa48f5d4a3cfd835465a10a04fe71c642f1e5 (diff) | |
download | bcfg2-e55ef35c002f4106a96f52fd0de1d7b13126fcc1.tar.gz bcfg2-e55ef35c002f4106a96f52fd0de1d7b13126fcc1.tar.bz2 bcfg2-e55ef35c002f4106a96f52fd0de1d7b13126fcc1.zip |
New models with Reasons; added Import script, to bring old data in to the database
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1888 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'reports/brpt/reports')
-rw-r--r-- | reports/brpt/reports/models.py | 36 | ||||
-rw-r--r-- | reports/brpt/reports/models.pyc | bin | 5369 -> 6518 bytes |
2 files changed, 28 insertions, 8 deletions
diff --git a/reports/brpt/reports/models.py b/reports/brpt/reports/models.py index ac3506214..63c86fee0 100644 --- a/reports/brpt/reports/models.py +++ b/reports/brpt/reports/models.py @@ -10,7 +10,24 @@ KIND_CHOICES = ( ('Directory', 'Directory'), ('Permissions','Permissions'), ) - +REASON_CHOICES = ( + ('', 'No Reason'), + ('O','Owner'), + ('P','Permissions'), + ('E','Existence'), + ('C','Content'), + ('OP','Owner, Permissions'), + ('OE','Owner, Existence'), + ('OC','Owner, Content'), + ('PE','Permissions, Existence'), + ('PC','Permissions, Content'), + ('EC','Existence, Content'), + ('OPE','Owner, Permissions, Existence'), + ('OPC','Owner, Permissions, Content'), + ('OEC','Owner, Existence, Content'), + ('PEC','Permissions, Existence, Content'), + ('OPEC','Owner, Permissions, Existence, Content'), +) class Client(models.Model): #This exists for clients that are no longer in the repository even! (timeless) creation = models.DateTimeField() @@ -88,37 +105,40 @@ class Interaction(models.Model): class Modified(models.Model): - interaction = models.ForeignKey(Interaction, related_name="modified_items", edit_inline=models.STACKED) + interactions = models.ManyToManyField(Interaction, related_name="modified_items") name = models.CharField(maxlength=128, core=True)#name of modified thing. kind = models.CharField(maxlength=16, choices=KIND_CHOICES)#Service/Package/ConfgFile... - how = models.CharField(maxlength=256) + problemcode = models.CharField(maxlength=8, choices=REASON_CHOICES) + reason = models.TextField(maxlength=1280) def __str__(self): return self.name class Extra(models.Model): - interaction = models.ForeignKey(Interaction, related_name="extra_items", edit_inline=models.STACKED) + interactions = models.ManyToManyField(Interaction, related_name="extra_items") name = models.CharField(maxlength=128, core=True)#name of Extra thing. kind = models.CharField(maxlength=16, choices=KIND_CHOICES)#Service/Package/ConfgFile... - why = models.CharField(maxlength=256)#current state of some thing... + problemcode = models.CharField(maxlength=8, choices=REASON_CHOICES) + reason = models.TextField(maxlength=1280) def __str__(self): return self.name class Bad(models.Model): - interaction = models.ForeignKey(Interaction, related_name="bad_items", edit_inline=models.STACKED) + interactions = models.ManyToManyField(Interaction, related_name="bad_items") name = models.CharField(maxlength=128, core=True)#name of bad thing. kind = models.CharField(maxlength=16, choices=KIND_CHOICES)#Service/Package/ConfgFile... - reason = models.CharField(maxlength=256)#that its bad... + problemcode = models.CharField(maxlength=8, choices=REASON_CHOICES) + reason = models.TextField(maxlength=1280) def __str__(self): return self.name #performance metrics, models a performance-metric-item class Performance(models.Model): - interaction = models.ForeignKey(Interaction, related_name="performance_items", edit_inline=models.STACKED) + interaction = models.ManyToManyField(Interaction, related_name="performance_items") metric = models.CharField(maxlength=128, core=True) value = models.FloatField(max_digits=32, decimal_places=16) def __str__(self): diff --git a/reports/brpt/reports/models.pyc b/reports/brpt/reports/models.pyc Binary files differindex 5d2c3cd75..935de1c5e 100644 --- a/reports/brpt/reports/models.pyc +++ b/reports/brpt/reports/models.pyc |