--- a/schemaviewer.py Wed Dec 09 16:07:07 2009 +0100
+++ b/schemaviewer.py Wed Dec 09 16:33:32 2009 +0100
@@ -9,7 +9,9 @@
_ = unicode
from logilab.common.ureports import Section, Title, Table, Link, Span, Text
+
from yams.schema2dot import CARD_MAP
+from yams.schema import RelationDefinitionSchema
I18NSTRINGS = [_('read'), _('add'), _('delete'), _('update'), _('order')]
@@ -185,7 +187,7 @@
rschema_objects = rschema.objects()
if rschema_objects:
# might be empty
- properties = [p for p in rschema.rproperty_defs(rschema_objects[0])
+ properties = [p for p in RelationDefinitionSchema.rproperty_defs(rschema_objects[0])
if not p in ('cardinality', 'composite', 'eid')]
else:
properties = []
@@ -201,8 +203,9 @@
done.add((objtype, subjtype))
data.append(Link(self.eschema_link_url(schema[subjtype]), subjtype))
data.append(Link(self.eschema_link_url(schema[objtype]), objtype))
+ rdef = rschema.rdef(subjtype, objtypep)
for prop in properties:
- val = rschema.rproperty(subjtype, objtype, prop)
+ val = getattr(rdef, prop)
if val is None:
val = ''
elif isinstance(val, (list, tuple)):