I wanted to serialize an object in xml for a client application from app-engine. I started using the django 1.2 serialization described here:
http://docs.djangoproject.com/en/1.2/topics/serialization/
from django.core import serializers
....
data = serializers.serialize("xml", TestObject.all())
It raises the following error:
raise base.SerializationError("Non-model object (%s) encountered during serialization" % type(obj))
SerializationError: Non-model object () encountered during serial开发者_C百科ization
which I assume is django not liking the app-engine db.Model objects. Is there another way to go about this?
Do you need the XML to be in a specific format? All db.Model
objects have a built-in to_xml()
method that conforms to Atom & GData specs. Is that useful?
精彩评论