How can this be that this error was raised? I entered this:
def json(self):
return json.dumps(
{
'items': self.items
}
)
and got that error (because self.items was an empty queryset (Django)
but then,
def json(self):
return json.dumps(
{
'items': [] # Pass in empty list to prove that the error was idiotic.
}
)
worked fine (which at least proves that the error message is worthless)
Is this because the queryset defines repr() and returns '[]' as a string when it's empty or something ridiculous like that?