This is the exact problem I'm having too.

As you say, isChanged() is False, but isAnyChanged() shows True...
save() does not give any message at all, while saveAll() gives the
"Invalid row specified." Exception.

I'm also adding the bizobjs in afterInit(), but at the Form level. I set
the from clause and do a requery from a child panel.


MySQL 5
Platform: Win
Python Version: 2.4.4 on win32
Dabo Version: Version 0.8.3; Revision ~3849
UI Version: 2.8.6.1 on wxMSW


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Nate Lowrie
Sent: 9. januar 2008 01:15
To: Dabo Users list
Subject: [dabo-users] Problem with BizObj save

John and I have been tackling this all afternoon...

I have a bizobj that is a standard bizobj.  Here's the code.

class CustomerBizobj(dabo.biz.dBizobj):
        def afterInit(self):
                self.addFrom("customers")
                self.addField("LastName")
                self.addField("FirstName")
                self.addField("Address")
                self.addField("City")
                self.addField("State")
                self.addField("ZipCode")
                self.addField("ID")
                
                self.KeyField = "ID"
                self.NonUpdateFields=["ID"]

It is the DataSource on a dGrid object.  The grid updates perfectly
and the bizobj reads all of the Records in the MySql database fine.  I
can write to the database with the biz object directly with the
execute method and everything works fine.  When I call Bizobj.new(), I
get a new Record that is inserted with blank values.  When I change
any one of those values, it is reflected in the dataset.  However,
whenever I called dBizobj.isChanged(), it is always false.  Save()
does not commit the data to the database.  It is almost like memento
is not recognizing it is changed.  So, I tried setting
dBizObj.SaveNewUnchanged to True.  When I ran dBizObj.save(), I got a
prompt asking if I wanted to save changes.  I selected yes and it
still did not save the changes.

The bizobj instance is added to the form.  I did not do this in the
form's createBizobjs method though.  It was done in the afterInit in a
dPanel.  John thought that this might have something to do with it,
but I am not sure.  I am stuck here and really need to get this
working.

database: MySQL 5
Platform: GTK
Python Version: 2.5.1 on linux2
Dabo Version: Version 0.8.3; Revision 3849
UI Version: 2.8.4.0 on wxGTK (gtk2)

Let me know what else you need.

Nate L.


[excessive quoting removed by server]

_______________________________________________
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