'Update the joins for a table
@param tablename: the tablename
@param joins: the list of joins for this table'

def __setitem__(self, tablename, joins):

    master = self.tablename
    joins_dict = self.joins
    tables = current.db._adapter.tables
    joins_dict[tablename] = joins
    if (len(joins) > 1):
        for join in joins:
            try:
                tname = join.first._tablename
            except AttributeError:
                tname = str(join.first)
            if ((tname not in joins_dict) and (master in tables(join.second))):
                joins_dict[tname] = [join]
    self.tables.add(tablename)
    return
