Commit 929bcebb by Maxime

Add a better str function for models

parent b3034e54
......@@ -4,6 +4,9 @@ from django.db import models
class LoggedApplication(models.Model):
name = models.CharField(blank=False, max_length=80)
def __str__(self):
return self.name
class LogViewer(models.Model):
application = models.ForeignKey('LoggedApplication', on_delete=models.CASCADE, related_name='logs')
......@@ -12,4 +15,7 @@ class LogViewer(models.Model):
def set_content(self):
f = open(self.path, 'r')
self.content = list(f)
\ No newline at end of file
self.content = list(f)
def __str__(self):
return self.name
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment