| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from django.db import models |
||
| 5 | class TestMachine(models.Model): |
||
| 6 | name = models.CharField(null=True, blank=True, max_length=50, help_text="Human-readable name of this machine.") |
||
| 7 | host = models.CharField(null=True, max_length=50, help_text="UUID of this machine.") |
||
| 8 | last_contact = models.DateTimeField(editable=False, default=timezone.now) |
||
| 9 | config = models.TextField(null=True, help_text="Host configuration in JSON format.") |
||
| 10 | enabled = models.BooleanField(default=True, help_text="Test machines can be temporarily disabled for maintenance. All jobs are held back during that time.") |
||
| 11 | |||
| 12 | class Meta: |
||
| 13 | app_label = 'opensubmit' |
||
| 14 | |||
| 15 | def __str__(self): |
||
| 16 | if self.name: |
||
| 17 | return self.name |
||
| 18 | else: |
||
| 19 | return "Test Machine {0}".format(self.pk) |
||
| 20 |