>Again, that's what PKs are for: to link tables, and that's what Dabo uses. But >your sample >code didn't provide the other columns that were required. Once I change it to >include a >default value, the code worked fine. >-- Ed Leafe ======================== excuse me for a long email.
I think I have not explained the task to correctly. Let me start from the beginning. I have the following tables already populated. Table 'mdlmst'-- colum names are: mdlmstid, mdlmstcd, mdlmstnm. values are: (1, 'BOLX', 'Bolero LX'), (2, 'SCORX', 'Scorpio LX'), (3, 'SCORVX', 'Scorpio VX') Table 'wrmst'-- colum names are: wrmstid, wrmstcd, wrmstnm. values are: (1, 'stdwarr', 'Std. warranty'), (2, 'extwarr1', 'extended warranty 1'), (3, 'extwarr2', 'extended warranty 2') What I want to achieve is: In the glue table, 'mdlwr', the associations are to be defined. In a Form, two list-boxes will be pre-populated with values from masters - mdlmst & wrmst. The user would make selections and click on 'save'. (If she can't find a value in list-box, there are separate Forms to add the master entries). Coming to my code: Whether mmAddtoBoth(wrBizObj,"mdlmstid", '1', "wrmstid", '1') is the right method to insert record in the 'glue' table? I am confused by its name - mmAddtoBoth. It seems that this method is for adding records to the 2 tables, mdlmst & wrmst. Is it so? Else, if this method is meant for adding record to 'glue' table, both the values are present in their respective tables. Then why this traceback is encountered: (I have now provided in my code the default values, which while creating bizobj subclasses-- self.DefaultValues = {'wrmstid':'-1', 'wrmstnm':'w'} ) .... .... File "f:\py\dabo\db\dCursorMixin.py", line 386, in execute raise dException.DBQueryException(errMsg) DBQueryException: (1048, "Column 'wrmstid' cannot be null") Maybe, providing pkids of other tables in 'glue' table is a problem. Should I provide my code again for your ready reference? --- Thanks, Vineet --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/1317362023.51982.yahoomail...@web160518.mail.bf1.yahoo.com