SE/relacion.py
def update(self, expr, dic):
        '''
        Updates certain values of a relation.

        expr must be a valid Python expression that can contain field names.

        This operation will change the relation itself instead of generating a new one,
        updating all the tuples where expr evaluates as True.

        Dic must be a dictionary that has the form "field name":"new value". Every kind of value
        will be converted into a string.

        Returns the number of affected rows.
        '''
        self._make_writable(copy_content=False)
        affected = self.selection(expr)
        not_affected = self.difference(affected)

        new_values = tuple(
            zip(self.header.getAttributesId(dic.keys()), dic.values())
        )

        for i in set(affected.content):
            i = list(i)

            for column, value in new_values:
                i[column] = value
            not_affected.insert(i)

        self.content = not_affected.content
        return len(affected)

        Updates certain values of a relation.

        expr must be a valid Python expression that can contain field names.

        This operation will change the relation itself instead of generating a new one,
        updating all the tuples where expr evaluates as True.

        Dic must be a dictionary that has the form "field name":"new value". Every kind of value
        will be converted into a string.

        Returns the number of affected rows.
        
Updates certain values of a relation.
expr must be a valid Python expression that can contain field names.

This operation will change the relation itself instead of generating a new one,
updating all the tuples where expr evaluates as True.

Dic must be a dictionary that has the form "field name":"new value". Every kind of value
will be converted into a string.

Returns the number of affected rows.
Updates certain values of a relation . expr must be a valid Python expression that can contain field names . This operation will change the relation itself instead of generating a new one updating all the tuples where expr evaluates as True . Dic must be a dictionary that has the form " field name " : " new value " . Every kind of value will be converted into a string . Returns the number of affected rows .
def update(self, expr, dic):
        self._make_writable(copy_content=False)
        affected = self.selection(expr)
        not_affected = self.difference(affected)
        new_values = tuple(
            zip(self.header.getAttributesId(dic.keys()), dic.values())
        )
        for i in set(affected.content):
            i = list(i)
            for column, value in new_values:
                i[column] = value
            not_affected.insert(i)
        self.content = not_affected.content
        return len(affected)
def update ( self , expr , dic ) : self . _make_writable ( copy_content = False ) affected = self . selection ( expr ) not_affected = self . difference ( affected ) new_values = tuple ( zip ( self . header . getAttributesId ( dic . keys ( ) ) , dic . values ( ) ) ) for i in set ( affected . content ) : i = list ( i ) for column , value in new_values : i [ column ] = value not_affected . insert ( i ) self . content = not_affected . content return len ( affected )
Updates certain values of a relation.
Updates certain values of a relation .
'''
        Updates certain values of a relation.

        expr must be a valid Python expression that can contain field names.

        This operation will change the relation itself instead of generating a new one,
        updating all the tuples where expr evaluates as True.

        Dic must be a dictionary that has the form "field name":"new value". Every kind of value
        will be converted into a string.

        Returns the number of affected rows.
        '''
self
expr
dic