Changeset 404

Show
Ignore:
Timestamp:
Mon May 19 22:06:24 2008
Author:
Brian
Message:

Add Object API to Data. Add ORM Diagram Report.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • scripts/trunk/ORM/Install ORM Tables.py

    r371 r404  
    23 23 # 070907 - more corrections and additions  
    24 24 # 080130 - several minor changes  
    25    
    26   # These design notes are intended to explore the problem. They include more than will be  
    27   #   implemented in the initial version.  
      25 # 080519 - separate out ORM Meta-Model Reports  
    28 26  
    29 27 def DoAdd():  
    30       # Specified all required Report Types and Column Types  
    31       # It will either add them or update them if they already exist.  
    32    
    33   #       Report  
    34   #           set it so that data.py won't manage the rows - done  
    35    
    36   #       ReportRow - all diagram objects are represented as a report row  
    37   #       - ID  
    38   #       - ReportID  
    39   #       - PosX      # these refer to the center of the object (the target of arrows pointing to the object)  
    40   #       - PosY  
    41   #                   # this line connects these two objects, follow each end if it is moved  
    42   #       - NodeAID   # these are pointers to other ReportRow objects that are the ends of a connector  
    43   #       - NodeBID  
    44   #       - OffsetX   # Text that is displayed offset from the main object (that text is separately moveable)  
    45   #       - OffsetY   # needed for role, probably not for reading  
    46   #       - Moveable  # can this object be moved with the mouse - is this needed????  
    47   #       - FollowID  # if this ID is moved, follow it - is this needed? - maybe - for reading?  
    48    
    49   #       ORMObject  
    50   #       - ID  
    51   #       - ProjectID (Schema)  
    52   #       - Name  
    53   #       - RefMode = identifier used to refer to instances of object  
    54   #       - Type ['Entity', 'Value']  
    55   #       - Independent [None, '!']  
    56   #       - Derived [None, '*', '+']  
    57   #       - DerivationRule  
    58    
    59 28     rt = { 'Name': 'ORM Diagram', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    60              'SuggestedColumns': ',ID;,Name', 'AdjustRowOption': 'ORMDiagram' }  
    61       ct = [  
    62       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    63       { 'Name': 'Name',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    64           ]  
    65       Data.AddReportType(rt, ct)  
    66    
    67    
    68       rt = { 'Name': 'ORM ObjectTypes', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    69              'SuggestedColumns': ',ID;,Name;,RefMode;,Type;,Independent;,Derived;,DerivationRule;,DateAdded' }  
    70       ct = [  
    71       { 'Name': 'ProjectID',    'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    72       { 'Name': 'Project/Name', 'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    73       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    74       { 'Name': 'Name',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    75       { 'Name': 'RefMode',      'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    76       { 'Name': 'Type',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    77       { 'Name': 'Independent',  'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 75  },  
    78       { 'Name': 'Derived',      'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    79       { 'Name': 'DerivationRule',  'Label': None,          'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 180  },  
    80       { 'Name': 'Description',  'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    81       { 'Name': 'DateAdded',    'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    82           ]  
    83       Data.AddReportType(rt, ct)  
    84    
    85   #       ORMFact  
    86   #       - ID  
    87   #       - ProjectID (Schema)  
    88   #       - Nary (1 ..)  
    89   #       - ORMFactReadingID         # prefered reading  
    90   #       - Derived [None, '*', '+']  
    91   #       - DerivationRule  
    92    
    93   # in graphic  
    94   #       - Rotation ['h', 'v']  # horizontal, vertical  
    95   #       - Order ['n', 'r']  # roles display in normal or reversed order  
    96    
    97    
    98       rt = { 'Name': 'ORM FactTypes', 'TableA': 'ORMFactType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    99              'SuggestedColumns': ',ID;,Name;,Nary;,ORMReadingID;,Derived;,DerivationRule;,DateAdded' }  
      29            'SuggestedColumns': ',ID;,Name',  
      30            'AdjustRowOption': 'ORMDiagram',  # any value here prevents automatic row creation  
      31            'PanelType': 'ORMDiagram',  # tentative names  
      32            }  
    100 33     ct = [  
    101       { 'Name': 'ProjectID',    'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    102       { 'Name': 'Project/Name', 'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    103 34     { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    104       # why do I have name? -- New to ORM2 (see ref doc p.6?) - not displayed in diagram, used for naming tables  
    105 35     { 'Name': 'Name',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    106       { 'Name': 'Nary',          'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    107       { 'Name': 'ORMFactReadingID',   'Label': 'ReadingID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    108       { 'Name': 'Derived',       'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    109       { 'Name': 'DerivationRule',  'Label': None,          'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 180  },  
    110       { 'Name': 'Description',  'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    111       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    112           ]  
    113       Data.AddReportType(rt, ct)  
    114    
    115   #       ORMReading  (follows the fact, but has it's own X&Y)  
    116   #       - ID  
    117   #       - ProjectID (Schema)  
    118   #       - ORMFactID  
    119   #       - Preference  (integer 1 or 2)  
    120   #       - Reading (reading text refers to role ids??)  
    121   #       - ORMReadingAltID            # do I need this????  
    122    
    123   # in graphic  
    124   #       - Orientation ['l', 'r', 'u', 'd']  # left, right, up, down  
    125    
    126       rt = { 'Name': 'ORM FactReadings', 'TableA': 'ORMFactReading', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    127              'SuggestedColumns': ',ID;,ORMFactTypeID;,Reading;,DateAdded' }  
    128       ct = [  
    129       { 'Name': 'ProjectID',     'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    130       { 'Name': 'Project/Name',  'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    131       { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    132       { 'Name': 'ORMFactTypeID', 'Label': 'ORMFactTypeID',  'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    133       { 'Name': 'Preference',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    134       { 'Name': 'Reading',       'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    135       { 'Name': 'ORMFactReadingAltID','Label': 'FactReadingAltID', 'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 75  },  
    136       { 'Name': 'Unique',        'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    137       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    138           ]  
    139       Data.AddReportType(rt, ct)  
    140    
    141   #       ORMRole  (the role name can be positioned, but the line end points follow the entities and facts  
    142   #       - ID  
    143   #       - ProjectID (Schema)  
    144   #       - ORMFactID - NodeA in the report row  
    145   #       - ORMObjectID - NodeB in the report row  
    146   #       - Seq = sequence number - this identifies the position of the role in the fact  
    147   #       - Name  
    148   #       - Mandatory ['a', 'd']  
    149   #       - Unique ['a', 'd']  
    150    
    151       rt = { 'Name': 'ORM Role', 'TableA': 'ORMRole', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    152              'SuggestedColumns': ',ID;,ORMFactTypeID;,Seq;,Name;,Mandatory;,Unique;,DateAdded' }  
    153       ct = [  
    154       { 'Name': 'ProjectID',     'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    155       { 'Name': 'Project/Name',  'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    156       { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    157       { 'Name': 'ORMFactTypeID',     'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    158       { 'Name': 'ORMObjectTypeID',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    159       { 'Name': 'Seq',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    160       { 'Name': 'Name',          'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    161       { 'Name': 'Mandatory',     'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    162       { 'Name': 'Unique',        'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    163       { 'Name': 'ORMRoleLabelID', 'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    164       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    165           ]  
    166       Data.AddReportType(rt, ct)  
    167    
    168   # shouldn't really be needed, but it gives the grapic something to point to  
    169       rt = { 'Name': 'ORM Role Label', 'TableA': 'ORMRoleLabel', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    170              'SuggestedColumns': ',ID;,ORMRoleID' }  
    171       ct = [  
    172       { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    173       { 'Name': 'ORMRoleID',     'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    174       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    175 36         ]  
    176 37     Data.AddReportType(rt, ct)  
    177 38  
    178   #       ORMConstraint  
    179   #       - ID  
    180   #       - ProjectID (Schema)  
    181   ##       - Name  
    182   #       - Type ['a', 'd']  
    183   #       - Unique ['a', 'd']  
    184   #       - ORMPathID  
    185   #       - ORMPathAltID  
    186    
    187       rt = { 'Name': 'ORM Constraints', 'TableA': 'ORMConstraint', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    188              'SuggestedColumns': ',ID;,Type;,Alethic;,DateAdded' }  
    189       ct = [  
    190       { 'Name': 'ProjectID',     'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    191       { 'Name': 'Project/Name',  'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    192       { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    193       { 'Name': 'Type',          'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    194       { 'Name': 'Alethic',       'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    195       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    196           ]  
    197       Data.AddReportType(rt, ct)  
    198    
    199       rt = { 'Name': 'ORM Constraint Connectors', 'TableA': 'ORMConstraintConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    200              'SuggestedColumns': ',ID;,ORMConstraintID;,TableName;,TableID' }  
    201       ct = [  
    202       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    203       { 'Name': 'ORMConstraintID',    'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    204   #    { 'Name': 'ORMRoleID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    205       { 'Name': 'TableName',    'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    206       { 'Name': 'TableID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    207           ]  
    208       Data.AddReportType(rt, ct)  
    209    
    210       rt = { 'Name': 'ORM Subtype Connectors', 'TableA': 'ORMSubtypeConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    211              'SuggestedColumns': ',ID;,ORMObjectTypeID;,ORMSubtypeID' }  
    212       ct = [  
    213       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    214       { 'Name': 'ORMObjectTypeID','Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    215       { 'Name': 'ORMSubtypeID',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    216           ]  
    217       Data.AddReportType(rt, ct)  
    218    
    219   #       ORMPath  
    220   #       - ID  
    221   #       - ProjectID (Schema)  
    222   ##       - Name  
    223    
    224   #       ORMPathLink  
    225   #       - ID  
    226   #       - ProjectID (Schema)  
    227   #       - ORMRole  
    228   #       - Sequence  (1 ..)  
    229    
    230   #       ORMNote  
    231   #       - ID  
    232   #       - ProjectID (Schema)  
    233   #       - Text  
    234    
    235       rt = { 'Name': 'ORM Notes', 'TableA': 'ORMNote', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    236              'SuggestedColumns': ',ID;,Text' }  
    237       ct = [  
    238       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    239       { 'Name': 'Text',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 300  },  
    240           ]  
    241       Data.AddReportType(rt, ct)  
    242    
    243   #       ORMNoteConnector  
    244   #       - ID  
    245   #       - ProjectID (Schema)  
    246   #       - ORMNoteID  # notes are always at one end of the note connector  
    247   #       - TableName - this is the way ganttpv points to any object  
    248   #       - TableID  
    249    
    250       rt = { 'Name': 'ORM Note Connectors', 'TableA': 'ORMNoteConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    251              'SuggestedColumns': ',ID;,ORMNoteID;,TableName;,TableID' }  
    252       ct = [  
    253       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    254       { 'Name': 'ORMNoteID',    'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    255       { 'Name': 'TableName',    'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    256       { 'Name': 'TableID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    257           ]  
    258       Data.AddReportType(rt, ct)  
    259    
    260   # --------------------------  
    261    
    262   ### instead of a report object, it might be better just to use the good old report row?  
    263   ##    rt = { 'Name': 'ORM Report Objects', 'TableA': 'ORMReportObject', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    264   ##           'SuggestedColumns': ',ReportID;,Report/Name;,ID;,ORMObjectID;,ORMObject/Name;,PosX;,PosY;,DateAdded' }  
    265   ##    ct = [  
    266   ##    { 'Name': 'ProjectID',    'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 50  },  
    267   ##    { 'Name': 'Project/Name', 'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    268   ##    { 'Name': 'ReportID',     'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    269   ##    { 'Name': 'Report/Name',  'Label': 'Report\nName',   'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    270   ##    { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    271   ##    { 'Name': 'ORMObjectID',  'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    272   ##    { 'Name': 'ORMObject/Name', 'Label': 'ORMObject\nName', 'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    273   ##    { 'Name': 'PosX',         'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    274   ##    { 'Name': 'PosY',         'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    275   ##    { 'Name': 'DateAdded',    'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    276   ##        ]  
    277   ##    Data.AddReportType(rt, ct)  
    278    
    279   #       ReportORMFact  
    280   #       - ORMFactID  # many may point to same  
    281   #       - ReportID  
    282   #       - PosX  
    283   #       - PosY  
    284    
    285   #       ReportORMRole  
    286   #       - ORMRoleID  # many may point to same  
    287   #       - ReportID  
    288   #       - ReportORMFactID       # these determine where to draw the role  
    289   #       - ReportORMObjectID     #  
    290    
    291   #       ReportORMConstraint  
    292   #       - ORMConstraintID  # many may point to same  
    293   #       - ReportID  
    294   #       - PosX  
    295   #       - PosY  
    296    
    297   #       ReportORMNote  
    298   #       - ORMNoteID  # many may point to same  
    299   #       - ReportID  
    300   #       - PosX  
    301   #       - PosY  
    302   #       - ObjectType        # can point to any orm report object  
    303   #       - ObjectID  
    304    
    305   # This script must be run against each file to include the new report options.  
    306    
    307   # If you want to make sure the report types and column types you add don't conflict  
    308   #    with new releases of GanttPV, prefix the Name with "xx". For  
    309   #    example: "xxDocument", "xxOwner", "xxURL", etc.  
      39     Data.AddTable('ORMObjectType')  
      40     Data.AddTable('ORMFactType')  
      41     Data.AddTable('ORMFactReading')  
      42     Data.AddTable('ORMRole')  
      43     Data.AddTable('ORMRoleLabel')  
      44     Data.AddTable('ORMConstraint')  
      45     Data.AddTable('ORMConstraintConnector')  
      46     Data.AddTable('ORMSubtypeConnector')  
      47     Data.AddTable('ORMNote')  
      48     Data.AddTable('ORMNoteConnector')  
    310 49  
    311 50     # add required data tables  
    312   #    Data.AddTable('ProjectWeek')  
      51     Data.AddTable('GraphicObject')  
    312 51  
    313 52     # add required aliases  (It shouldn't take two steps  
    314       Data.Database['NodeA'] = Data.Database['ReportRow']  # Does this name work?  
    315       Data.Database['NodeB'] = Data.Database['ReportRow']  
    316       Data.AddAlias('NodeA', 'ReportRow')     # is this the best way to do this?  
    317       Data.AddAlias('NodeB', 'ReportRow')  
      53 #    Data.Database['NodeA'] = Data.Database['GraphicObject']  # Does this name work?  
      54 #    Data.Database['NodeB'] = Data.Database['GraphicObject']  
      55     Data.AddAlias('NodeA', 'GraphicObject')     # is this the best way to do this?  
      56     Data.AddAlias('NodeB', 'GraphicObject')  
    318 57  
    319       Data.Database['ORMSubtype'] = Data.Database['ORMObjectType']  
      58 #    Data.Database['ORMSubtype'] = Data.Database['ORMObjectType']  
    319 58     Data.AddAlias('ORMSubtype', 'ORMObjectType')  
    320 59  
    321       Data.Database['ORMFactReadingAlt'] = Data.Database['ORMFactReading']  
      60 #    Data.Database['ORMFactReadingAlt'] = Data.Database['ORMFactReading']  
    321 60     Data.AddAlias('ORMFactReadingAlt', 'ORMFactReading')  
    322 61  
    323 62     Data.SetUndo("Install ORM Tables")  
    324 63  
    325   # do only if GanttPV version 0.2 or greater  
    326 64 DoAdd()  
  • scripts/trunk/ORM/Open ORM Window.py

    r372 r404  
    68 68 import wx.lib.ogl as ogl  
    69 69 ogl.OGLInitialize()  # affter app object, but before OGL is used  
    70   db = Data._dbDatabase(Data.Database)  # will get objects from this database  
      70 db = Data.DB(Data.Database)  # will get objects from this database  
    70 70 Data._db = db  # where should this be saved????? ---IMPORTANT TO FIX  
    71 71  
     
    1827 1827  
    1828 1828 # -----------  
    1829   class ORMShape(Data._dbObject):  
      1829 class ORMShape(Data.Object):  
    1829 1829         # add methods to shape object  
    1830 1830  
     
    3974 3974 ##            self.RedisplayID(shape.dcid)  
    3975 3975             self.RedrawID(shape.dcid)  
    3976               if shape.TableName in ('ORMFactType', 'ORMRole'):  # why not for everything??  
      3976             if shape.TableName in ('ORMObjectType', 'ORMFactType', 'ORMRole'):  # why not for everything??  
    3976 3976                 for follow in shape.GetFollowers():  # when typing into fact  
    3977 3977                     self.RedrawID(follow.dcid)