On Thursday 10 January 2008 04:59:44 am Simen Haugen wrote:
> Now I tried using only bnummer as the KeyField. The behaviour changed,
> but it still doesn't work...
>
> >>> b = self.getBizobj("tbl_matches")
> >>> b.getDataSet()
> >>> b.new()
> >>> b.setFieldVal("bnummer", "1")
> >>> b.setFieldVal("telefonval", "2")
> >>> b.getDataSet()
>
> ({'project': u'reshn011', 'bnummer': u'1', 'telefonval': u'2'},)
>
> >>> b.save()
>

>
> >>> b.saveAll() # No message at all
>
> When I used several primary fields, saveAll reported "Invalid row
> specified" and save() reported nothing, but now it's about the
> opposite...
> I still have all the fields as primary in my database. Could this be the
> problem?
> Anyway, I still want to use several primary keys so I can get away with
> only one table :)
>
> >From the APIDoc:
>
> KeyField
>
> Name of field that is the PK. If multiple fields make up the key,
> separate the fields with commas. (str)

>
> On Wednesday 09 January 2008 11:06:55 pm Simen Haugen wrote:
> > class MatchBiz(dbiz.dBizobj):
> >     def beforeInit(self):
> >         self.Caption = "Matches"
> >         self.Encoding = "latin-1"
> >         self.DataSource = "tbl_matches"
> >         self.KeyField = "project,bnummer,telefonval"
> >         self.AutoPopulatePK = False
> >


Yes I realize you want a composite PK.  I just think there maybe some sort of 
issue with the keys.  Next I would try moving your code from 'beforeInit' 
to 'afterInit'.  And if works try adding back one key at a time.

-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
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/dabo-users/[EMAIL PROTECTED]

Reply via email to