I am trying to make Django view that will give JSON responce with earliest and latest objects. But unfotunately it fails to work with this error.
'str' object has no attribute '_meta'
I have other serialization and it works.
Here is the code.
def get_calendar_limits(request): result = serializers.serialize('json', Session.objects.aggregate(Max('date'), Min('date')), ensure_ascii=False) return HttpResponse(result, mimetype='application/javascript')
Thanks a lot beforehand.
Take a look at the following:
You might want to just run the above in interactive Python as an experiment.
What type are your objects? Is that type serializable?