<https://lh5.googleusercontent.com/-kybjcR5IeLg/USI_PoFwEYI/AAAAAAAAAAM/qjEgUJHNrJA/s1600/tablas4.png>
Thanks a ton, Jose, I did a much more modest attempt at the same thing:

print 'digraph Bloques{\n' \
      'ranksep="2"\n' \
      'splines="true"\n'
for table in db:
    for field in table:
        if field.type.startswith('reference'):
            t = '%s -> %s'%(table, field.type[10:])
            type = field.type[10:]
        elif field.type.startswith('list:reference'):
            t = '%s -> %s [arrowhead="veevee" ]'%(table, field.type[15:])
        else: continue
        if field.name!=type:
             t += '[ label = "%s" ]'%field.name
        print t
print '}'


This generates a diagram with only the references between the tables, 
labeling the arrows if the field name is different from the target table.
Calling 

dot -Tpng db.dot -o db_picture.png

gives a file like in the example above.

BTW; have you considered using canviz?:

 http://code.google.com/p/canviz/
I'm not sure it does what Massimo wants, because it might need the 
coordinates of the points, that are obtained with a call to 'dot'.

Regards

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to