Refer to documentation here
More specifically for def __str__(self):
“The __str__() method is called whenever you call str() on an object. The main use for this method directly inside Django is when the repr() output of a model is displayed anywhere (for example, in debugging output). Thus, you should return a nice, human-readable string for the object’s __str__().”
Error: if you put an integer here it will throw a type error!
The error would look like:
TypeError at /admin/ __str__ returned non-string (type datetime.date)
Solution is to use python’s conversion to string method str():