On Tuesday 05 May 2009 01:07:48 pm Paul McNett wrote: > Steve Litt wrote: > > Hi all, > > > > How do I narrow down this problem? My AppWizard generated program can > > view the data but gets a traceback when I try to write it. > > > > I used AppWizard to build a "hello word" from Postgres database test with > > single table people consisting of an autoincrement called person_id, and > > text fields fname, lname and job. The generated app was able to view the > > data, but when I tried to add, it failed with the following trace: > > [snip] > > > File > > "/usr/lib/python2.5/site-packages/Dabo-0.9.1-py2.5.egg/dabo/db/dCursorMix > >in.py", line 760, in genTempAutoPK > > pkVal = rec[kf] > > KeyError: '' > > Is there a primary key defined in the postgres table? If so, it appears > that AppWizard didn't identify it as such when generating the app. > > Try going into the generated bizobj and adding to initProperties(): > self.KeyField = "person_id" > self.AutoPopulatePK = True > > Paul
I always get confused as to the meaning of AuotPopulatePK. If the PO has "person_id" defined as data type serial (auto-increment) Dabo should NOT supply a PK number. He should also set bizobj.NonUpdateFields=['person_id'] -- John Fabiani _______________________________________________ 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/200905051313.26054.jfabi...@yolo.com