[PyQt] use dip with a classic parent child relationship

Phil Thompson phil at riverbankcomputing.com
Wed Jan 15 22:22:23 GMT 2014


On 15-01-2014 9:09 pm, John Fabiani wrote:
> On 01/15/2014 11:14 AM, John Fabiani wrote:
>> On 01/15/2014 10:57 AM, Phil Thompson wrote:
>>> On 15-01-2014 6:38 pm, John Fabiani wrote:
>>>> Hi,
>>>> I have reviewed the doc's and the examples (well at least once).  
>>>> So
>>>> far it looks like alot of the automatic stuff is done and lot's of
>>>> ways to deal with making changes.
>>>>
>>>> But I don't see the an example of the classic parent ->childl
>>>> ->grandchild model.  The standard invoice header with invoice line
>>>> items where there are two tables used.
>>>> How is that done?  I did not gather the info from the doc (or I 
>>>> missed it).
>>>
>>> I'm not sure I understand the question.
>>>
>>> If you are expecting dip to automatically create a usable GUI for 
>>> you for an arbitrary model then you are going to be disappointed. 
>>> Automatically created GUIs are Ok so long as they are kept simple - 
>>> for things like dialogs or wizards, or parts of a bigger GUI.
>>>
>>> Phil
>>> _______________________________________________
>>> PyQt mailing list    PyQt at riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>> No nothing to do with the GUI (view).  But how to associate a table 
>> with a child table.  The classic is the you have a grid at the top of 
>> a form with all the invoices associated with a customer (in the grid). 
>> Below you have a grid with all the line items associated with the 
>> invoice (header).
>>
>> In this case the parent is the customer record, the child is the 
>> invoice headers, and the grandchild is the line items.
>>
>> one to many to many relationship.
>>
>> I'll guess and suggest the you create some sort of trigger action in 
>> the model?  Then somehow you have to write a controller????  Or is all 
>> of that done in some auto way?
>>
>> Johnf
>>
> I kept reading and maybe I have discovered that the model is not
> complete.  Meaning that it does not have a way to save to a 
> persistent
> database?  And I got that from the roadmap.  So my question on
> parent->child didn't make sense due to the current state of dip.  Is
> that correct. If so is there a spec you have developed that I might
> follow to develop the code.

No, there is no automatic persistence. I have been experimenting with 
an IModel which the rest of dip would use rather than the concrete Model 
implementation. You could then implement an adapter between IModel and 
your favourite ORM.

Phil


More information about the PyQt mailing list