On Mon, Feb 14, 2011 at 9:55 AM, Matteius <matte...@gmail.com> wrote:
> I want to optimize my json call and protect data by doing something
> like:
>
>
>        assignments = Assignment.objects.values('id',
> 'name').filter(course=enrollment.course)
>        payload = serializers.serialize("json", assignments,
>                                        ensure_ascii=False)
>
>
> But my experience and others have been:
>
> (' dict object has no attribute __meta').
>
>
>
> The only option I see is to manually encode a json string and bypass
> the serialization?

This question is very close to being a "How To" question.
Django-developers is for discussing the development of Django itself.
If you want to ask how to do something, you should ask on
django-users.

However -- just in case this was a misphrased request for discussion
of a feature proposal: Django's serializers are not universal
serializers. They are specifically for serializing full querysets --
i.e., collections of full objects. If you want to serialize other
structures, you need to use simplejson.dumps natively.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to