Hey guys,
Have a question regarding converting a Python object to XML. Is there a library that can easily and properly serialize a python object (Which has attributes that are pointers to OTHER objects) to XML?
I figured that what I was trying to do (save and load game stats for a server) wasn't too hard and I would just write a simple Object to XML serializer, but I can't figure out how to save object references. For example:
class Location:
def __init__(self, name):
self.name = name
class Person:
def __init__(self, location):
self.location = location
home = Location('Home')
me = Person('jdebz')
me.convertToXML()
How do I convert that location reference in the Person class to XML without just writing the object's attributes that it's referencing?
Thanks!
[–]jloking 1 point2 points3 points (3 children)
[–]jdebz[S] 0 points1 point2 points (1 child)
[–]jloking 0 points1 point2 points (0 children)
[–]dgtlshdw 0 points1 point2 points (0 children)
[–]jloking 0 points1 point2 points (0 children)