def rename(self, newname):
        if hasattr(self, '_table'):
            (comptype, objtype) = (self._table.objtype, 'COLUMN')
            compname = self._table.qualname()
        elif hasattr(self, '_type'):
            (comptype, objtype) = ('TYPE', 'ATTRIBUTE')
            compname = self._type.qualname()
        else:
            raise TypeError("Cannot determine type of %s", self.name)
        stmt = "ALTER %s %s RENAME %s %s TO %s" % (
            comptype, compname, objtype, self.name, newname)
        self.name = newname
        return stmt
Get all relations of the specified relation type
dataset/ETHPy150Open perseas/Pyrseas/pyrseas/dbobject/column.py/Column.rename--crossover with--dataset/ETHPy150Open callowayproject/django-categories/categories/models.py/Category.get_relation_type