from django.db import models


class DevEventType(models.Model):
    name = models.CharField(max_length=128)

    def __str__(self):
        return self.name


class DevEventLog(models.Model):
    name = models.CharField(max_length=128)
    event_time = models.DateTimeField(auto_now_add=True, blank=True)
    event_type = models.ForeignKey(DevEventType, on_delete=models.CASCADE)
    description = models.TextField()

    def __str__(self):
        return self.event_type.name + ": " + self.name
