I found what I needed here
http://blog.michaeltrier.com/2007/7/30/json-generic-serializer
Ashish
On Mar 31, 2:27 pm, ydjango <[EMAIL PROTECTED]> wrote:
> thanks.
>
> also when I add 'id' in fields, it appears to just ignore it, I get
> back only food_name , group and description. Is it by desi
thanks.
also when I add 'id' in fields, it appears to just ignore it, I get
back only food_name , group and description. Is it by design or a bug?
serializers.serialize('json',Food.objects.filter(group__exact=my_group),fields=('id','food_name','group','description'))
thanks
Ashish
On Mar 31,
On Mon, 31 Mar 2008, ydjango wrote:
> u'jsklajdkls'}, {'food_name': u'PMC', 'group': 1L, 'description':
> u'jsklajdkls'}]
> ( why do I see u before text in output above?)
It indicates that they're unicode strings.
--~--~-~--~~~---~--~~
You received this message b
I was able to get this to work. There was an import error from my
side,
data =
serializers.serialize('json',Food.objects.filter(group__exact=my_group),fields=('food_name','group','description'))
following two serialization ways gave me exception -
'dict' object has no attribute '_meta'
a) json_o
4 matches
Mail list logo