[Fixed]-Return QuerySet as JSON. Using values() function leads to missing values

1👍

Methods __unicode__ or __str__ are only for representation when you print an object, it doesn’t means that if you return an instance will work in that way. You have to return the information you need serializing the data.

EDIT: Also you can use select_related method in order to avoid extra queries.

ModelItem.objects.select_related('item_owner').filter(item_owner=user_id)

Leave a comment