equal
deleted
inserted
replaced
23 * rename entity type |
23 * rename entity type |
24 |
24 |
25 The following data actions are supported for now: |
25 The following data actions are supported for now: |
26 * add an entity |
26 * add an entity |
27 * execute raw RQL queries |
27 * execute raw RQL queries |
28 |
|
29 |
|
30 """ |
28 """ |
|
29 |
31 from __future__ import with_statement |
30 from __future__ import with_statement |
32 |
31 |
33 __docformat__ = "restructuredtext en" |
32 __docformat__ = "restructuredtext en" |
34 |
33 |
35 import sys |
34 import sys |
1229 entity = self._cw.create_entity(etype, **kwargs) |
1228 entity = self._cw.create_entity(etype, **kwargs) |
1230 if commit: |
1229 if commit: |
1231 self.commit() |
1230 self.commit() |
1232 return entity |
1231 return entity |
1233 |
1232 |
|
1233 def cmd_reindex_entities(self, etypes=None): |
|
1234 """force reindexaction of entities of the given types or of all |
|
1235 indexable entity types |
|
1236 """ |
|
1237 from cubicweb.server.checkintegrity import reindex_entities |
|
1238 reindex_entities(self.repo.schema, self.session, etypes=etypes) |
|
1239 |
1234 @deprecated('[3.5] use create_entity', stacklevel=3) |
1240 @deprecated('[3.5] use create_entity', stacklevel=3) |
1235 def cmd_add_entity(self, etype, *args, **kwargs): |
1241 def cmd_add_entity(self, etype, *args, **kwargs): |
1236 """add a new entity of the given type""" |
1242 """add a new entity of the given type""" |
1237 return self.cmd_create_entity(etype, *args, **kwargs).eid |
1243 return self.cmd_create_entity(etype, *args, **kwargs).eid |
1238 |
1244 |