fix merge problem
[sfa.git] / sfa / util / record.py
index 0fcef2a..7ebf379 100644 (file)
@@ -4,14 +4,11 @@
 # TODO: Use existing PLC database methods? or keep this separate?
 ##
 
-### $Id$
-### $URL$
-
 from types import StringTypes
 
-from sfa.trust.gid import *
+from sfa.trust.gid import GID
 
-from sfa.util.parameter import *
+from sfa.util.parameter import Parameter
 from sfa.util.xrn import get_authority
 from sfa.util.row import Row
 from sfa.util.xml import XML 
@@ -282,6 +279,7 @@ class SfaRecord(Row):
         """
         Load the record from a dictionary 
         """
+
         self.set_name(dict['hrn'])
         gidstr = dict.get("gid", None)
         if gidstr:
@@ -305,7 +303,7 @@ class SfaRecord(Row):
         recorddict = self.as_dict()
         filteredDict = dict([(key, val) for (key, val) in recorddict.iteritems() if key in self.fields.keys()])
         record = XML('<record/>')
-        record.root.attrib.update(filteredDict)
+        record.parse_dict(filteredDict)
         str = record.toxml()
         return str
 
@@ -319,9 +317,9 @@ class SfaRecord(Row):
         representation of the record.
         """
         #dict = xmlrpclib.loads(str)[0][0]
-        
+
         record = XML(str)
-        self.load_from_dict(record.root.attrib)
+        self.load_from_dict(record.todict())
 
     ##
     # Dump the record to stdout