From 2005c0f24f6b59ee530dd38925f16b99d189e170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Mon, 26 Feb 2018 17:03:27 +0100 Subject: [PATCH] Add xml string gen --- histories/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/histories/models.py b/histories/models.py index a1f2147..1df5d89 100644 --- a/histories/models.py +++ b/histories/models.py @@ -136,6 +136,10 @@ class History(models.Model): if standalone: return xml_root + def to_xml_string(self): + xml = self.to_xml() + return ET.tostring(xml) + @staticmethod def from_xml(xml_root): ''' Loads an history from an XML file '''