TestMachine   A
last analyzed

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __str__() 0 5 2
1
from django.db import models
2
from django.utils import timezone
3
4
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