Re: json serialization question

2011-05-27 Thread Ian Clelland
On Tue, May 24, 2011 at 8:36 AM, Sells, Fred wrote: > My code looks like this > > records = models.Residents.objects.extra( where=[], params=[...]) > data = serializers.serialize('json', records, ensure_ascii=False, > fields=('fname','lname', 'pt')) > return HttpResponse(data) > > After experi

json serialization question

2011-05-24 Thread Sells, Fred
I'm using AJAX, jquery and JSON for the first time, having used templates to render XML for Flex/Flash in all my previous Django work. My code looks like this records = models.Residents.objects.extra( where=[], params=[...]) data = serializers.serialize('json', records, ensure_ascii=False, fie

Re: serialization question

2006-12-19 Thread limodou
On 12/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I ended up creating a dict with the gpuser stuff I wanted and returning it. Seems to work. Yeah, I always do like yours. Create dict seems more sophisticated. -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My B

Re: serialization question

2006-12-19 Thread [EMAIL PROTECTED]
I ended up creating a dict with the gpuser stuff I wanted and returning it. Seems to work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@goo

Re: serialization question

2006-12-19 Thread [EMAIL PROTECTED]
Except I don't want all the GpUsers, just the matching one (gpuser). I'm also confused why the json code I have (taken from James Bennett) is differs from the docs, and wonder which would be better for my purposes. --~--~-~--~~~---~--~~ You received this message

Re: serialization question

2006-12-18 Thread Deryck Hodge
On 12/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I use a generic detail view to show user info. I want to also be able > to return that info via ajax, but I'm having trouble getting ALL the > user stuff. Here's the view: > > def view_profile(request, slug, js=''): > from django.vi

serialization question

2006-12-18 Thread [EMAIL PROTECTED]
I use a generic detail view to show user info. I want to also be able to return that info via ajax, but I'm having trouble getting ALL the user stuff. Here's the view: def view_profile(request, slug, js=''): from django.views.generic.list_detail import object_detail auth_user = User.objec