I have a simple model class which I want to return the the value for a field in my Django Admin.
Error Logs from terminal
TypeError: __str__ returned non-string (type NoneType)
models.py
class Solution(models.Model):
description = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
user = models.ForeignKey(User, on_delete=models.CASCADE)
error = models.ForeignKey(Error, on_delete=models.CASCADE)
def __str__(self):
return self.error + " fixed by " + self.user