dabo Commit
Revision 4891
Date: 2008-12-27 11:00:34 -0800 (Sat, 27 Dec 2008)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4891
Changed:
U trunk/dabo/biz/dBizobj.py
Log:
Took Paul's suggestion and changed 'setValuesByDict()' to 'setValues()'. This
method will still take a dict of fieldname/value pairs, but also accepts
keyword args, with the fieldname as the keyword and the new value as the
argument.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2008-12-27 18:01:49 UTC (rev 4890)
+++ trunk/dabo/biz/dBizobj.py 2008-12-27 19:00:34 UTC (rev 4891)
@@ -1381,10 +1381,14 @@
return ret
- def setValuesByDict(self, valDict, row=None):
+ def setValues(self, valDict=None, row=None, **kwargs):
"""Allows you to set the value for multiple fields with one
call by passing a dict
containing the field names as keys, and the new values as
values.
"""
+ if valDict is None:
+ valDict = kwargs
+ else:
+ valDict.update(kwargs)
cursor = self._CurrentCursor
if cursor is not None:
try:
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]