Changeset 448
- Timestamp:
- Mon Jun 16 12:27:22 2008
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
-
scripts/trunk/Object Role Modeling/Install ORM Meta-Model Reports.py
r446 r448 62 62 # - DerivationRule 63 63 64 rt = { 'Name': 'ORM Object Types', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',64 rt = { 'Name': 'ORM Object Type', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 64 64 'SuggestedColumns': ',ID;,Name;,RefMode;,Type;,Independent;,DataType;,Derived;,DerivationRule;,DateAdded' } 65 65 ct = [ … … 97 97 98 98 99 rt = { 'Name': 'ORM FactTypes', 'TableA': 'ORMFactType', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 100 'SuggestedColumns': ',ID;,Name;,Nary;,Unique;,Derived;,DerivationRule;,DateAdded' } 99 rt = { 'Name': 'ORM Fact Type', 'TableA': 'ORMFactType', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 100 'SuggestedColumns': ',ID;,ORMFactReading/Reading;,RoleSequence;,Name;,Nary;,Unique;,Derived;,DerivationRule;,DateAdded' } 101 101 ct = [ 102 102 { 'Name': 'ProjectID', 'Label': 'Project\nID', 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 50 }, … … 104 104 { 'Name': 'ID', 'Label': None, 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35 }, 105 105 # why do I have name? -- New to ORM2 (see ref doc p.6?) - not displayed in diagram, used for naming tables 106 { 'Name': 'ORMFactReading/Reading','Label': 'Preferred\nReading','DataType': 't','AccessType': 'i', 'T': 'A', 'Edit': True, 'Width': 120 }, 107 { 'Name': 'RoleSequence','Label': 'Role\nSequence', 'DataType': 't','AccessType': 'role2', 'T': 'A', 'Edit': False, 'Width': 120, 108 'Path': 'ORMFactReading/ORMRoleSequence/ORMRolePosition-ORMRoleSequenceID: ORMRole/ORMObjectType/Name, Seq'}, 106 109 { 'Name': 'Name', 'Label': None, 'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 100 }, 107 110 { 'Name': 'Nary', 'Label': None, 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 40 }, 108 { 'Name': 'Unique', 'Label': None, 'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 35},111 { 'Name': 'Unique', 'Label': None, 'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 50 }, 108 111 { 'Name': 'ORMFactReadingID', 'Label': 'ReadingID', 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 35 }, 109 112 ## { 'Name': 'ORMObjectTypeID', 'Label': 'ReadingID', 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 35 }, … … 127 130 # - Orientation ['l', 'r', 'u', 'd'] # left, right, up, down 128 131 129 rt = { 'Name': 'ORM Fact Readings', 'TableA': 'ORMFactReading', 'TableB': None, 'Also': None, 'AllOrEach': 'each',132 rt = { 'Name': 'ORM Fact Reading', 'TableA': 'ORMFactReading', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 129 132 'SuggestedColumns': ',ID;,ORMFactTypeID;,Reading;,DateAdded' } 130 133 ct = [ … … 194 197 ### - ORMPathAltID 195 198 196 rt = { 'Name': 'ORM Constraint s', 'TableA': 'ORMConstraint', 'TableB': None, 'Also': None, 'AllOrEach': 'each',199 rt = { 'Name': 'ORM Constraint', 'TableA': 'ORMConstraint', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 196 199 'SuggestedColumns': ',ID;,Type;,Alethic;,DateAdded' } 197 200 ct = [ … … 323 326 # - Text 324 327 325 rt = { 'Name': 'ORM Note s', 'TableA': 'ORMNote', 'TableB': None, 'Also': None, 'AllOrEach': 'each',328 rt = { 'Name': 'ORM Note', 'TableA': 'ORMNote', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 325 328 'SuggestedColumns': ',ID;,Text' } 326 329 ct = [ … … 338 341 # - TableID 339 342 340 rt = { 'Name': 'ORM Note Connector s', 'TableA': 'ORMNoteConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',343 rt = { 'Name': 'ORM Note Connector', 'TableA': 'ORMNoteConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 340 343 'SuggestedColumns': ',ID;,ORMNoteID;,TableName;,TableID' } 341 344 ct = [ … … 350 353 # Tables and Columns from Rmap 351 354 352 rt = { 'Name': 'RelationalTable', 'TableA': 'RelationalTable', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 355 rt = { 'Name': 'Relational Table', 'TableA': 'RelationalTable', 'TableB': None, 'Also': None, 'AllOrEach': 'each', 352 355 'SuggestedColumns': ',ID;,Name;,OverrideName;,InUse;,InBase;,TableName;,TableID' } 353 356 ct = [ … … 366 369 Data.AddReportType(rt, ct) 367 370 368 rt = { 'Name': 'RelationalTable/RelationalColumn', 'TableA': 'RelationalTable', 'TableB': 'RelationalColumn', 'Also': 'RelationalTable', 'AllOrEach': 'each', 369 'SuggestedColumns': 'RelationalTable,ID;RelationalTable,Name;,ID;,Seq;,Name;,DataType;,PrimaryKey;,OverrideName;,OverrideDataType;,OverridePrimaryKey;,InUse;,InBase;,TableName;,TableID' } 371 rt = { 'Name': 'Relational Table / Relational Column', 'TableA': 'RelationalTable', 'TableB': 'RelationalColumn', 'Also': 'Relational Table', 'AllOrEach': 'each', 372 'SuggestedColumns': 'Relational Table,ID;Relational Table,Name;,ID;,Seq;,Name;,DataType;,PrimaryKey;,OverrideName;,OverrideDataType;,OverridePrimaryKey;,InUse;,InBase;,TableName;,TableID' } 370 373 ct = [ 371 374 { 'Name': 'ID', 'Label': None, 'DataType': 'i', 'AccessType': 'd', 'T': 'B', 'Edit': False, 'Width': 35 }, -
scripts/trunk/Object Role Modeling/Rmap.py
r446 r448 21 21 if not name: 22 22 name = objecttype.Name # entity name 23 ## if name and name[0].isupper(): 24 ## name = name[0].lower() + name[1:] 23 if name and name[0].isupper() and not name.isupper(): 24 name = name[0].lower() + name[1:] 25 25 return name 26 26 … … 32 32 print 'adding', key, obj_list 33 33 if key not in table: 34 table[key] = [] 34 if obj.Table == 'ORMObjectType': 35 table[key] = [obj] 36 else: 37 table[key] = [] 35 38 table[key].extend(obj_list) 36 39 … … 39 42 for objecttype in objecttype_list: 40 43 if objecttype.Independent: 41 AddToTable(objecttype, [ objecttype])44 AddToTable(objecttype, []) 41 44 42 45 fact_list = project.GetList('ORMFactType') … … 64 67 AddToTable(role[1].ORMObjectType, [role[0]]) 65 68 66 # should update table definition to match 67 # currently it always creates new tables 69 # update table definitions to match rmap results 68 70 def FindByTarget(obj_list, target): 69 71 ''' find object in list that points to target'''
