Ok, I'm trying to use a simple bizobj that I made. I now get "Failed
to create newval for field 'field name'" Is there there any
documentation that I missed that shows the basic use of a bizobj?
Here is my new code:
class testbiz(biz.dBizobj):
def initProperties(self):
self.Caption = "mytesttable"
self.DataSource = "mytesttable"
self.KeyField = "theid"
self.RequeryOnLoad = False
self.Encoding = "latin-1"
mybiz = testbiz(conn)
mybiz.new()
mybiz.first_name = 'Brandon'
mybiz.last_name = 'Singer'
mybiz.amount_owes = 1234.01
mybiz.save()
ps. what is the best way to get all the data? should I use the bizobj?
On 1/26/06, Ed Leafe <[EMAIL PROTECTED]> wrote:
> On Jan 26, 2006, at 12:32 PM, Echo wrote:
>
> > I am trying to insert some data into a table I just made. I get an
> > exception when I try to do a cur.save(). The exception I get is "No
> > data to save". Is there something I am missing or doing wrong?
>
> Yes. You are inserting the records into the database directly,
> rather than adding them to the cursor's local data store. save() is
> designed to take changes to the cursor's local data store and write
> them back to the database. Since you bypassed the local data store,
> there was nothing for the cursor to save.
>
> If you work directly with the cursor, you call cursor.new() to
> create a new, blank record, and then populate the fields using
> setFieldVal(fld, val). I usually prefer working with business
> objects, since I can call:
> bizobj.new()
> bizobj.field1 = "Foo"
> bizobj.field2 = "Bar"
> bizobj.save()
>
>
> -- Ed Leafe
> -- http://leafe.com
> -- http://dabodev.com
>
>
>
>
> _______________________________________________
> Post Messages to: [email protected]
> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
>
--
-Echo
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users