I have models for eg like this
class Model():
time=models.DateTimeField()
free=models.BooleanField(default=False)
user=models.ForeignKey(User) //it is my own User class
full_info=models.TextField()
than I serialize it:
data=serializers.serialize("json",Model.objects.all())
return HttpResponse(data,mimetype='application/json')
and here is my jquery code I use to fetch it:
$.post("/url",data,
function(data){
}, "json"
);
And my question is how to write all information from jason about model?For eg I want that in one paragraph tag will be one object with all information about it. How I can do this? Thanks for help
Best Regards
Check out the format that the serializer spits out (via your browser or shell):
So it’s a list of arrays with
pk,model, andfieldswhich is an array.