>On Oct 10, 2011, at 10:57 AM, Vineet Deodhar wrote:
> I was just wondering whether it would make sense to have a 'save' method that
> can accept a tuple of dictionaries (like what we get from the getDataSet).
> For every dictionary in the tuple, a new record would be added to the DB.
> (Searched the dabo-docs to look for something similar, but could not find)
> dBizobj.appendDataSet(ds)
>Docstring: Appends the rows in the passed dataset to this bizobj's dataset.
>No checking is done on the dataset columns to make sure that they are correct
>for this bizobj;
> it is the responsibility of the caller to make sure that they match.
>If invalid data is passed, a dException.FieldNotFoundException will be raised.
>-- Ed Leafe
-----------------------------------------
I did this---
>> dts = ({'distnm': 'delmenow11', 'statid': 17},)
>> distBizObj.appendDataSet(dts)
>> distBizObj.save()
Also tried distBizObj.new() before these statements.
I checked the SQL generated by DABO:
SQL & PARAMS : update `dist` set `dist`.`distnm` = %s, `dist`.`statid` = %s
where `dist`.`distid`=0 ('delmenow11', 17)
I don't understand why it is this where clause --- where `dist`.`distid`=0
Getting a traceback--
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "f:\py\dabo\biz\dBizobj.py", line 484, in save
cursor.save(includeNewUnchanged=True)
File "f:\py\dabo\db\dCursorMixin.py", line 1623, in save
saverow(row)
File "f:\py\dabo\db\dCursorMixin.py", line 1587, in saverow
self.__saverow(row)
File "f:\py\dabo\db\dCursorMixin.py", line 1741, in __saverow
self.BackendObject.noResultsOnSave()
File "f:\py\dabo\db\dBackend.py", line 111, in noResultsOnSave
raise dException.dException(_("No records updated"))
dException: No records updated
What does that indicate?
---Vineet
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
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/[email protected]