On 10/6/06, Daniel Roseman <[EMAIL PROTECTED]> wrote:
> Thanks a lot, this is exactly the sort of thing I was after.
> Unfortunately, it doesn't seem to work on JSON. Running from the shell,
> I get the following:
>
> >>> serializers.serialize('json', sec.article_set.all(), fields=('id', 
> >>> 'name'))
> Traceback (most recent call last):
>   File "<console>", line 1, in ?
>   File "c:\mydown~1\django_mr\django\core\serializers\__init__.py",
> line 55, in serialize
>     s.serialize(queryset, **options)
>   File "c:\mydown~1\django_mr\django\core\serializers\base.py", line
> 52, in serialize
>     self.end_serialization()
>   File "c:\mydown~1\django_mr\django\core\serializers\json.py", line
> 19, in end_serialization
>     simplejson.dump(self.objects, self.stream,
> cls=DateTimeAwareJSONEncoder, **self.options)
>   File "c:\mydown~1\django_mr\django\utils\simplejson\__init__.py",
> line 115, in dump
>     check_circular=check_circular, allow_nan=allow_nan,
> TypeError: __init__() got an unexpected keyword argument 'fields'
>
> It works OK on XML, though. Any ideas?
>

Thanks, Daniel, for the traceback.  I think I know why this is
happening -- it's related to the relationship and the conditional I
used.  I'll test with a similar example and update the patch.

Sorry for the delay, too.  Been offline with the birth of a new baby.
:-)  Should have a new patch in a day or so, as time allows.

Cheers,
deryck

-- 
Deryck Hodge                            http://www.devurandom.org/
Samba Team                                        http://www.samba.org/

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to