Changeset 447

Show
Ignore:
Timestamp:
Mon Jun 16 12:20:16 2008
Author:
Brian
Message:

In Data.py, Alex added access type 'role2' for a sorted list display in a report cell. In ORM.py, Alex fixed some places where project id wasn't added to database records. I added the delete icon to the tool bar and did some work to get delete undo and redo working better. In QuickStart?.py, I drafted the quick start help for ORM.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • ganttpv/trunk/ORMReport.py

    r430 r447  
    56 56     pnl2.demo = parent  # so control panel can save data at application level  
    57 57     win = ORM.MyCanvas(pnl, wx.ID_ANY, log, report=report)  
      58     pnl2.win = win  # so toolbar buttons can reach canvas  
    58 59     pnl.win = win  # so ormreport can call canvas  
    59 60     win.demo = parent  # so canvas can save data at application level  
  • ganttpv/trunk/QuickStart.py

    r303 r447  
    26 26 # 061230 - Brian - more revisions to text  
    27 27 # 070328 - Brian - improved Resources text to respond to Blake's beta test comment  
      28 # 080615 - Brian - drafted ORM help  
    28 29  
    29 30 overview = """  
     
    242 243 """  
    243 244  
      245 orm = """  
      246 <html><body>  
      247 <hd3>What is Object Role Modeling?</hd3>  
      248 <p>Object Role Modeling (ORM) is the most powerful and easiest to learn  
      249 approach to information modeling and relational database design. Everyone who  
      250 designs or works with databases will find it useful to learn. http://orm.net/ is  
      251 a good place to start.</p>  
      252 <p>Run the <i>Install ORM Diagram</i> script to add ORM reports to the menus.</p>  
      253 <ul>  
      254 <li><i>ORM Diagram</i> - draw ORM diagrams to capture information requirements (see ORM in shortcuts help) </li>  
      255 <li><i>ORM Object Type</i> - edit object type names, specify data types</li>  
      256 <li><i>ORM Fact Type</i> - edit fact readings, specify fact names</li>  
      257 <li><i>Relational Table</i> - override generated table names</li>  
      258 <li><i>Relational Table / Relational Column</i> - override generated column names and data types</li>  
      259 </ul>  
      260 <p>Important scripts:</p>  
      261 <ul>  
      262 <li><i>Rmap</i> - generate relational tables and columns based on model</li>  
      263 <li><i>Rmap Baseline</i> - remember current tables for comparison with future changes</li>  
      264 <li><i>Generate SQL</i> - generate draft table 'create' statments based  
      265 the current Rmap relational table results</li>  
      266 <li><i>Generate SQL Deltas</i> - generate draft of SQL statements to help  
      267 convert old baseline tables to the current design</li>  
      268 </ul>  
      269 </body></html>  
      270 """  
      271  
    244 272 finding_help = """  
    245 273 <html><body>  
     
    374 402 </body></html>  
    375 403 """  
      404 shortcuts_d = """  
      405 <html><body>  
      406 <hd3>ORM Diagram Shortcuts</hd3>  
      407 <p>Add an Object Type</p>  
      408 <ul>  
      409 <li>Hold the shift key and click on the canvas</li>  
      410 </ul>  
      411 <p>Add a Fact Type</p>  
      412 <ul>  
      413 <li>Hold the shift key and drag from an Object Type to  
      414 the canvas</li>  
      415 </ul>  
      416 <p>Add another Role to a Fact Type</p>  
      417 <ul>  
      418 <li>Hold the shift key and drag from an Object Type to  
      419 a Fact Type or vice versa</li>  
      420 </ul>  
      421 <p>Add a Constraint</p>  
      422 <ol>  
      423 <li>Right-click (control-click on Mac) on a role box</li>  
      424 <li>Select menu option</li>  
      425 </ol>  
      426 <p>Add an External Constraint</p>  
      427 <ol>  
      428 <li>Right-click (control-click on Mac) on canvas</li>  
      429 <li>Select "Role Constraint" from popup menu</li>  
      430 <li>Right-click (control-click) on Constraint circle</li>  
      431 <li>Select constraint type</li>  
      432 <li>Click on a Role box</li>  
      433 <li>Control-click (command-click) to add more Roles to the sequence  
      434 (Note the numbers in the role boxes)</li>  
      435 <li>Shift-click on the Constraint circle</li>  
      436 <li>Repeat as necessary</li>  
      437 </ol>  
      438 </body></html>  
      439 """  
  • ganttpv/trunk/ORM.py

    r445 r447  
    1964 1964             if self.dcid in self.canvas.objids:  
    1965 1965                 self.canvas.objids.remove(self.dcid)  
    1966           self._SetInShell('dcid', None)  
    1967           self._SetInShell('canvas', None)  
      1966         # self._SetInShell('dcid', None)  
      1967         # self._SetInShell('canvas', None)  
    1968 1968         Data.Object.Delete(self)  
    1969 1969  
     
    3878 3878         clist.ORMConstraintID = target.ID  
    3879 3879         clist.Seq = len(priorlists)+1  # next number  
      3880         projectid = self.Report.ProjectID  
      3881         clist.ProjectID = projectid  
    3880 3882         today = Data.TodayString()  
    3881 3883         clist.DateAdded = today  
     
    3886 3888             crole.ORMRoleID = role.ID  
    3887 3889             crole.Seq = i + 1  
      3890             crole.ProjectID = projectid  
    3888 3891             crole.DateAdded = today  
    3889 3892             fact_type_ids[role.ORMFactTypeID] = None  
     
    4140 4143         # undelete objects will be in this list, but shouldn't be in self.objids  
    4141 4144         for shape in self.Report.GetList('GraphicObject'):  
    4142    
      4145             shape.Follow()  # some will be there already, some won't  
    4142 4145             x, y = shape.PosX, shape.PosY    # undo of moves (temp pos doesn't undo)  
    4143 4146             if x != None and y != None:  
     
    5181 5184         self.report_toolbar.AddRadioLabelTool(ID.NORMAL, _("Normal Mode"), Menu.Bitmap("icons/Pointer.bmp", wx.BITMAP_TYPE_ANY), wx.NullBitmap, _("Normal Mode"), _("Dragging will select and move objects"))  
    5182 5185         self.report_toolbar.AddRadioLabelTool(ID.DRAW, _("Drawing Mode"), Menu.Bitmap("icons/Pencil.bmp", wx.BITMAP_TYPE_ANY), wx.NullBitmap, _("Drawing Mode"), _("Dragging will create and connect objects"))  
      5186         self.report_toolbar.AddSeparator()  
      5187         self.report_toolbar.AddSeparator()  
      5188         self.report_toolbar.AddLabelTool(ID.DELETE, _("Delete"), Menu.Bitmap("icons/Delete.bmp", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Delete"), _("Delete selected objects"))  
    5183 5189         self.report_toolbar.Realize()  
    5184 5190    
     
    5203 5209         wx.EVT_TOOL(self, ID.NORMAL, self.OnNormal)  
    5204 5210         wx.EVT_TOOL(self, ID.DRAW, self.OnDraw)  
      5211         wx.EVT_TOOL(self, ID.DELETE, self.OnDelete)  
    5205 5212  
    5206 5213     def OnChange(self, event):  
     
    5226 5233         event.Skip()  
    5227 5234  
      5235     def OnDelete(self, event):  
      5236         shapes = [ self.win.dcid_to_shape_xref.get(x) for x in self.win.GetSelection() ]  
      5237         for shape in shapes:  
      5238             if shape.IsUIDeletable():  
      5239                 shape.Delete()  
      5240         Data.SetUndo('Deletion')  
      5241         self.win.RedrawAll()  
      5242  
    5228 5243 class TreeControlPanel(wx.Panel):  
    5229 5244     def __init__(self, parent, id, pos=wx.DefaultPosition,  
  • ganttpv/trunk/Menu.py

    r406 r447  
    624 624     list.append([name, text])  
    625 625  
      626     name = "ORM"  
      627     text = QuickStart.orm  
      628     list.append([name, text])  
      629  
    626 630     name = "Finding Help"  
    627 631     text = QuickStart.finding_help  
     
    667 671     list.append([name, text])  
    668 672  
      673     name = "ORM"  
      674     text = QuickStart.shortcuts_d  
      675     list.append([name, text])  
      676  
    669 677     hwin = NBFrame(self, "Shortcuts", list)  
    670 678     hwin.Show()  
  • ganttpv/trunk/Data.py

    r445 r447  
    1614 1614                         vals.append(v)  
    1615 1615                 value = ", ".join(vals)  
      1616             elif at == 'role2':  
      1617                 # like role, but instead of displaying the secondary values,  
      1618                 # the primary values are sorted on them  
      1619                 record = Database[rtable][tid]  
      1620                 path = ct.get('Path') or ct.get('Name')  
      1621                 vals = []  
      1622                 for record in ParseBranching(record, path):  
      1623                     subvals = []  
      1624                     for branch in record:  
      1625                         branch = [str(x) for x in branch if x != None]  
      1626                         v = ", ".join(branch)  
      1627                         subvals.append(v)  
      1628                     if subvals:  
      1629                         v = subvals.pop(0) or "--"  
      1630                         vals.append((subvals, v))  
      1631                 vals.sort()  
      1632                 vals = [v[1] for v in vals]  
      1633                 value = ", ".join(vals)  
    1616 1634             elif at == 'list':  # deprecated v0.7  
    1617 1635                 try: