equal
deleted
inserted
replaced
121 raise KeyError |
121 raise KeyError |
122 def set_entity_cache(self, entity): |
122 def set_entity_cache(self, entity): |
123 pass |
123 pass |
124 |
124 |
125 def create_entity(self, etype, *args, **kwargs): |
125 def create_entity(self, etype, *args, **kwargs): |
126 """add a new entity of the given type""" |
126 """add a new entity of the given type |
|
127 |
|
128 Example (in a shell session): |
|
129 |
|
130 c = create_entity('Company', name='Logilab') |
|
131 create_entity('Person', ('works_for', 'Y'), Y=c.eid, firstname='John', lastname='Doe') |
|
132 |
|
133 """ |
127 rql = 'INSERT %s X' % etype |
134 rql = 'INSERT %s X' % etype |
128 relations = [] |
135 relations = [] |
129 restrictions = [] |
136 restrictions = [] |
130 cachekey = [] |
137 cachekey = [] |
131 for rtype, rvar in args: |
138 for rtype, rvar in args: |