Commit b0944f21 authored by Jacek Furmankiewicz's avatar Jacek Furmankiewicz

issue 4: improved serialization of object graphs to XML

parent 5d592fa9
...@@ -7,12 +7,8 @@ for JSON/XML/YAML output ...@@ -7,12 +7,8 @@ for JSON/XML/YAML output
''' '''
import collections import collections
from jinja2 import Template
from UserDict import DictMixin from UserDict import DictMixin
xmlListTemplate = Template("""<list>{% for item in items %}<item>{% for prop,val in item.iteritems() %}<{{prop}}>{{val}}</{{prop}}>{% endfor %}</item>{% endfor %}</list>""")
xmlTemplate = Template("""<item>{% for prop,val in item.iteritems() %}<{{prop}}>{{val}}</{{prop}}>{% endfor %}</item>""")
primitives = (int, long, float, bool, str,unicode) primitives = (int, long, float, bool, str,unicode)
def convertForSerialization(obj): def convertForSerialization(obj):
......
...@@ -104,6 +104,7 @@ Changelog ...@@ -104,6 +104,7 @@ Changelog
* 0.0.16: * 0.0.16:
- minor bug fix for issue #4 (serializing object graphs to XML): - minor bug fix for issue #4 (serializing object graphs to XML):
https://github.com/jacek99/corepost/issues/3 https://github.com/jacek99/corepost/issues/3
As a result removed Jinja2 as a dependency, no longer needed by default
* 0.0.15: * 0.0.15:
- minor bug fixes in auto-converting responses to JSON and parsing arguments/paths with unexpectec characters - minor bug fixes in auto-converting responses to JSON and parsing arguments/paths with unexpectec characters
* 0.0.14: * 0.0.14:
...@@ -162,8 +163,7 @@ setup( ...@@ -162,8 +163,7 @@ setup(
install_requires=[ install_requires=[
'twisted>=12.0.0', 'twisted>=12.0.0',
'formencode>=1.2.4', 'formencode>=1.2.4',
'pyyaml>=3.1.0', 'pyyaml>=3.1.0'
'jinja2>=2.6',
], ],
tests_require=[ tests_require=[
'httplib2>=0.7.1', 'httplib2>=0.7.1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment