--- a/cwvreg.py Thu Aug 13 10:49:46 2009 +0200
+++ b/cwvreg.py Thu Aug 13 10:50:19 2009 +0200
@@ -136,11 +136,11 @@
assert len(objects) == 1, objects
cls = objects[0]
if cls.id == etype:
- cls.__initialize__()
+ cls.__initialize__(self.schema)
return cls
cls = dump_class(cls, etype)
cls.id = etype
- cls.__initialize__()
+ cls.__initialize__(self.schema)
return cls
VRegistry.REGISTRY_FACTORY['etypes'] = ETypeRegistry
--- a/entity.py Thu Aug 13 10:49:46 2009 +0200
+++ b/entity.py Thu Aug 13 10:50:19 2009 +0200
@@ -170,13 +170,13 @@
MODE_TAGS = set(('link', 'create'))
CATEGORY_TAGS = set(('primary', 'secondary', 'generic', 'generated')) # , 'metadata'))
@classmethod
- def __initialize__(cls):
+ def __initialize__(cls, schema):
"""initialize a specific entity class by adding descriptors to access
entity type's attributes and relations
"""
etype = cls.id
assert etype != 'Any', etype
- cls.e_schema = eschema = cls.schema.eschema(etype)
+ cls.e_schema = eschema = schema.eschema(etype)
for rschema, _ in eschema.attribute_definitions():
if rschema.type == 'eid':
continue