On Sunday 13 January 2008 07:02:22 pm Adrian Klaver wrote:
> On Sunday 13 January 2008 6:37 pm, johnf wrote:
> > On Sunday 13 January 2008 04:18:58 pm Adrian Klaver wrote:
> > > On Sunday 13 January 2008 1:06 pm, Ed Leafe wrote:
> > > > On Jan 13, 2008, at 2:59 PM, Adrian Klaver wrote:
> > > > > Now that John has helped me past the Postgres sequence problem,
> > > > > I can report on my problems with new(). Below is cut and paste from
> > > > > my attempts with comments-
> > > >
> > > >         Can you re-post after fixing the capitalization problems? It's 
> > > > hard
> > > > to determine what is and is not due to those errors, and what is an
> > > > actual problem.
> > > >
> > > > -- Ed Leafe
> > >
> > > Sorry for the delay. I am up here in Washington State and the weather
> > > threw an Exception, the Sun came out. Anyway here goes my second
> > > attempt-
>
> <snip>
>
> > > New record sequence
> > >
> > > bz=self.getBizobj()
> > > self.new()
> > > bz.SaveNewUnchanged
> > > True
> > > bz.getRecordStatus()
> > > {}
> > > # Values below come from Default column settings in Postgres database.
> > > self.Season.Value
> > > u'annual'
> > > self.PlantType.Value
> > > u'flower'
> > > self.CategoryType.Value
> > > u'plant'
> > > self.CategorySubType.Value
> > > u'normal'
> > > self.Common.Value
> > > u''
> > > # Enter 'test' into dTextbox RegID Common
> > > self.Common.Value
> > > u'test'
> > > bz.getRecordStatus()
> > > {'common': (u'', u'test')}
>
> <snip>
>
> > > One more question. I updated the ClassDesigner but I don't see the Keys
> > > property in the Property List for a Dropdown List. Is it going to be in
> > > another revision?
> > >
> > >
> > > Thanks,
> >
> > As you discovered Dabo is not aware of Postgres default values.  The way
> > it can be done in Dabo is as follows in the bizObj:
> > self.DefaultValues={"PlantType":self._getPlantType}
>
> Dabo is aware of the default values. When I call self.new() the Dropdown
> Lists are populated with the correct default values from Postgres. Those
> are the self.'RegID'.Value items above.
That does not make sense to me.  The only way that can happen (at least in my 
mind) is if an insert and requery occurred.  I must be missing something?  
I'll test it sometime tomorrow.
>
> The constraint is:
> insert or update on table "plant1" violates foreign key
> constraint "plant1_category_fkey"
> DETAIL:  Key (category_type,category_sub_type)=(,) is not present in
> table "plant1_category
> Its a FK between plant1 and plant1_category. It only comes into play
> because the values for category_type and category_sub_type are not being
> picked up unless I explicitly select them. The problem isn't the
> constraint, its doing what it is supposed to, that is prevent entry of
> record that does not satisfy the FK relationship. The problem is that the
> values that are necessary to meet that constraint are not being included in
> the INSERT statement.
>
> > Can't help you with the ClassDesigner - that's Ed's domain.

Turn off the constraint.  And check the if the insert/save works.  I'll assume 
that will work because you are getting the  self.LinkField = "p_item_no" 
set - right?.  I'd then try setting the other FK stuff in either the 
berforeSave() or validateField.  


-- 
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