diff idavoll/pgsql_storage.py @ 202:77c61e2b8c75

Use `domish.Element`s to represent items, instead of serialized XML.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 25 Jun 2008 12:27:55 +0000
parents e404775b12df
children b4bf0a5ce50d
line wrap: on
line diff
--- a/idavoll/pgsql_storage.py	Tue Jun 24 08:42:16 2008 +0000
+++ b/idavoll/pgsql_storage.py	Wed Jun 25 12:27:55 2008 +0000
@@ -2,9 +2,13 @@
 # See LICENSE for details.
 
 import copy
+
+from zope.interface import implements
+
 from twisted.enterprise import adbapi
 from twisted.words.protocols.jabber import jid
-from zope.interface import implements
+
+from wokkel.generic import parseXml
 
 from idavoll import error, iidavoll
 
@@ -418,7 +422,7 @@
             cursor.execute(query, (self.nodeIdentifier))
 
         result = cursor.fetchall()
-        return [unicode(r[0], 'utf-8') for r in result]
+        return [parseXml(r[0]) for r in result]
 
 
     def getItemsById(self, itemIdentifiers):
@@ -436,7 +440,7 @@
                             itemIdentifier))
             result = cursor.fetchone()
             if result:
-                items.append(unicode(result[0], 'utf-8'))
+                items.append(parseXml(result[0]))
         return items