--- a/cwvreg.py Fri Sep 11 08:39:17 2009 +0200
+++ b/cwvreg.py Fri Sep 11 12:52:55 2009 +0200
@@ -130,19 +130,23 @@
baseschemas = [eschema] + eschema.ancestors()
# browse ancestors from most specific to most generic and try to find an
# associated custom entity class
+ cls = None
for baseschema in baseschemas:
try:
btype = ETYPE_NAME_MAP[baseschema]
except KeyError:
btype = str(baseschema)
- try:
- objects = self[btype]
- assert len(objects) == 1, objects
- cls = objects[0]
- break
- except ObjectNotFound:
- pass
- else:
+ if cls is None:
+ try:
+ objects = self[btype]
+ assert len(objects) == 1, objects
+ cls = objects[0]
+ except ObjectNotFound:
+ pass
+ else:
+ # ensure parent classes are built first
+ self.etype_class(btype)
+ if cls is None:
# no entity class for any of the ancestors, fallback to the default
# one
objects = self['Any']
--- a/server/querier.py Fri Sep 11 08:39:17 2009 +0200
+++ b/server/querier.py Fri Sep 11 12:52:55 2009 +0200
@@ -508,7 +508,7 @@
if repo.schema.rschema(rtype).inlined:
entity = session.entity_from_eid(subj)
entity[rtype] = obj
- repo.glob_update_entity(session, entity)
+ repo.glob_update_entity(session, entity, set((rtype,)))
else:
repo.glob_add_relation(session, subj, rtype, obj)