Commit a1a65c22 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[dataimport] ObjectStore.create_entity should return something that looks like...

[dataimport] ObjectStore.create_entity should return something that looks like an entity (eg no more using dict protocol to access to attributes)

branch : stable
parent 0f31a50b144e
......@@ -74,7 +74,7 @@ from StringIO import StringIO
from copy import copy
from datetime import datetime
from logilab.common import shellutils
from logilab.common import shellutils, attrdict
from import strptime
from logilab.common.decorators import cached
from logilab.common.deprecation import deprecated
......@@ -305,7 +305,8 @@ class ObjectStore(object):
return len(self.items) - 1
def create_entity(self, etype, **data):
data['eid'] = eid = self._put(etype, data)
data = attrdict(data)
data['eid'] = eid = self._put(etype, data)
self.eids[eid] = data
self.types.setdefault(etype, []).append(eid)
return data
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