Skip to content

Commit

Permalink
Merge pull request #29 from Igalia/fix-28
Browse files Browse the repository at this point in the history
Fix(#28) Add __str__ to models (help admin display)
  • Loading branch information
tonythomas01 authored Jul 15, 2018
2 parents 3ce0bbd + 5d8a938 commit 5cf7386
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dashboard/core/bots/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def is_authenticated(self):
def __unicode__(self):
return self.name

def __str__(self):
return self.name

def save(self, force_insert=False, force_update=False, using=None,
update_fields=None):
if not self.cpuArchitecture.enabled:
Expand Down
3 changes: 3 additions & 0 deletions dashboard/core/browsers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ class Browser(models.Model):
)
enabled = models.BooleanField(default=False)

def __str__(self):
return self.name

def __unicode__(self):
return self.name
3 changes: 3 additions & 0 deletions dashboard/core/cpus/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class CPUArchitecture(models.Model):
)
enabled = models.BooleanField(default=False)

def __str__(self):
return self.name

def __unicode__(self):
return self.name

3 changes: 3 additions & 0 deletions dashboard/core/gpus/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ class GPUType(models.Model):
)
enabled = models.BooleanField(default=False)

def __str__(self):
return self.name

def __unicode__(self):
return self.name
3 changes: 3 additions & 0 deletions dashboard/core/metric_units/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ class MetricUnit(models.Model):
_('Is Better'),max_length=2, choices=IS_BETTER_CHOICES,default='dw'
)

def __str__(self):
return self.name

def __unicode__(self):
return self.name
3 changes: 3 additions & 0 deletions dashboard/core/platforms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ class Platform(models.Model):
)
enabled = models.BooleanField(default=False)

def __str__(self):
return self.name

def __unicode__(self):
return self.name
6 changes: 4 additions & 2 deletions dashboard/core/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Test(models.Model):
)
enabled = models.BooleanField(default=False)

def __unicode__(self):
return self.id
def __str__(self):
return self.name

def __unicode__(self):
return self.id

0 comments on commit 5cf7386

Please sign in to comment.