main logo
Subject: [dabo-dev] dabo Commit 3417
Author: Ed Leafe
Posted: 2007/09/30 10:41:34
 
View Entire Thread
New Search


dabo Commit
Revision 3417
Date: 2007-09-30 08:41:34 -0700 (Sun, 30 Sep 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3417

Changed:
U trunk/dabo/db/dDataSet.py

Log:
Fixed a typo in the replace() method, and also changed the exec to an eval.


Diff:
Modified: trunk/dabo/db/dDataSet.py
===================================================================
--- trunk/dabo/db/dDataSet.py 2007-09-28 18:52:01 UTC (rev 3416)
+++ trunk/dabo/db/dDataSet.py 2007-09-30 15:41:34 UTC (rev 3417)
@@ -100,7 +100,7 @@
return None


- def replace(self, field, Expr, scope=None):
+ def replace(self, field, valOrExpr, scope=None):
"""Replaces the value of the specified field with the given expression.

All records matching the scope are affected; if no scope is specified,
@@ -108,7 +108,6 @@

Scope is a boolean expression.
"""
-
if scope is None:
scope = "True"
else:
@@ -125,8 +124,7 @@
if literal:
rec[field] = valOrExpr
else:
- expr = "rec['%s'] = %s" % (field, valOrExpr)
- exec(expr)
+ rec[field] = eval(valOrExpr)


def sort(self, col, ascdesc=None, caseSensitive=None):





 
©2007 Ed Leafe
<-- Prior Message New Search Next Message -->