On 19 déc, 00:13, "Mr. T" <ted.peder...@gmail.com> wrote:
> response = serializers.serialize('xml', MySet.objects.all())
> return HttpResponse(response , mimetype='text/xml;')
>
> The output has each member of "MySet" with an <object> tag, and then
> within the object, a bunch of <field> tags with each field.
Looks like a sensible schema....
<object pk="1" model="profiles.profile">
<field to="auth.user" name="user" rel="ManyToOneRel">1</field>
<field type="PositiveSmallIntegerField" name="gender">1</field>
<field type="DateField" name="birth_date">1967-01-05</field>
<field type="CharField" name="zip">33640</field>
<field type="CharField" name="city">Castres-Gironde</field>
<field type="FileField" name="mugshot">mugshots/bigb.jpeg</field>
</object>
> It seems
> sort of hard to parse this on the client side.
If the "client-side" is javascript code in a browser, use json instead
- you'll save quite a lot on both bandwidth and processing.
Else, I assume the client code is written in a language with decent
XML parsing support, and then I just don't see what's your problem
parsing such a simple and obvious schema.
> Can anyone help how to parse out a field,
Err... type and name are attributes, content is content ? What's your
problem exactly ???
> or to have the XML
> serializer just output something simpler?
Sorry but I fail to see what could be simpler.
--~--~---------~--~----~------------~-------~--~----~
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
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---