Paul McNett wrote:
> On 8/27/10 10:33 AM, Ed Leafe wrote:
>> On Aug 27, 2010, at 1:22 PM, Jim Byrnes wrote:
>>
>>>>> It may be apparent to a more experienced coder than myself
>>>>> but it seems Dabo's .save() needs a table with a primary key
>>>>> to work. Now to put this to use on the app I'm working on.
>>>>
>>>> Ooh, yeah, pk's are a definite requirement for updating records
>>>> (but not for querying).
>>>>
>>>> I wonder if we shouldn't be raising an exception that says
>>>> something like "Can't save a record with no KeyField defined."
>>>>
>>>> Thanks for following up on the problem.
>>>>
>>>> Paul
>>>>
>>>
>>> It would be helpful for a newbie like myself.  I thought I was
>>> doing something wrong in Dabo when it was really a table design
>>> mistake.
>>
>>
>> It's already sort of an exception: see
>> http://dabo.codepad.org/xwoyZv93
>>
>> The only way that that would not be triggered is if you defined the
>> PrimaryKey property for the bizobj. You said that there is no PK,
>> so what did you do for that?
>
> Probably should be 'if not self.KeyField' instead, to catch the ''
> and () cases. Actually, I'm surprised that some sort of exception
> isn't being raised upon save(). You'd think there'd be a database
> exception with sql that includes a field name that doesn't exist...
>
> Paul
>

I said I was a newbie, right? :) I first tried '', then I set it to the 
column that  will be the primary key once I fix the table. I just 
commented out the self.KeYField line in the  Bizobj file and ran the 
app.  It didn't save of course, but there was no error message in the 
terminal or raised by Dabo that I could see.

I hope I'm not misunderstanding your comments above.

Regards,  Jim
_______________________________________________
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/4c7802dd.9030...@comcast.net

Reply via email to