From 711426c23d296f5c5a5f6399f32a5310dccaa50c Mon Sep 17 00:00:00 2001 From: LtWorf Date: Tue, 10 Feb 2009 12:14:49 +0000 Subject: [PATCH] Corrected all 'touple' into 'tuple' git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@81 014f5005-505e-4b48-8d0a-63407b615a7c --- relation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/relation.py b/relation.py index 4000ed0..98d4bb0 100644 --- a/relation.py +++ b/relation.py @@ -423,7 +423,7 @@ class relation (object): '''Update, expr must be a valid boolean expression, can contain field names, constant, math operations and boolean ones. This operation will change the relation itself instead of generating a new one, - updating all the touples that make expr true. + updating all the tuples that make expr true. Dic must be a dictionary that has the form field name:value. Every kind of value will be converted into a string. Returns the number of affected rows.''' @@ -444,18 +444,18 @@ class relation (object): attributes[self.header.attributes[j]]=rdate(i[j]) else: attributes[self.header.attributes[j]]=i[j] - if eval(expr,attributes): #If expr is true, changing the touple + if eval(expr,attributes): #If expr is true, changing the tuple affected+=1 for k in range(len(keys)): i[f_ids[k]]=str(dic[keys[k]]) return affected def insert(self,values): - '''Inserts a touple in the relation. + '''Inserts a tuple in the relation. This function will not insert duplicate tuples. All the values will be converted in string. Will return the number of inserted rows.''' - #Returns if touple doesn't fit the number of attributes + #Returns if tuple doesn't fit the number of attributes if len(self.header.attributes) != len(values): return 0 @@ -474,7 +474,7 @@ class relation (object): '''Delete, expr must be a valid boolean expression, can contain field names, constant, math operations and boolean ones. This operation will change the relation itself instead of generating a new one, - deleting all the touples that make expr true. + deleting all the tuples that make expr true. Returns the number of affected rows.''' attributes={} affected=len(self.content)