I came across an error that was poorly explained when I wanted to customize the magic str function of my "ApiCall" model.
My Model :
FOO = 1
FOO2 = 2
FOO3 = 3
ROUTES = (
(FOO, "foo"),
(FOO2, "foo 2"),
(FOO3, "foo 3"),
)
class ApiCall(TimeStampedModel):
user = models.ForeignKey(MobileUser, on_delete=models.CASCADE)
route = models.PositiveSmallIntegerField('foo', choices=ROUTES)
def __str__(self):
return f"... {self.get_route_display}"
Error :
RecursionError: maximum recursion depth exceeded while calling a Python object