Remove remove_property

This commit is contained in:
Konsta Vesterinen
2014-02-22 10:31:27 +02:00
parent 218c6682af
commit 4b492f1b31

View File

@@ -10,24 +10,6 @@ from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.orm.util import AliasedInsp
def remove_property(class_, name):
"""
**Experimental function**
Remove property from declarative class
"""
mapper = class_.mapper
table = class_.__table__
columns = class_.mapper.c
column = columns[name]
del columns._data[name]
del mapper.columns[name]
columns._all_cols.remove(column)
mapper._cols_by_table[table].remove(column)
mapper.class_manager.uninstrument_attribute(name)
del mapper._props[name]
def primary_keys(class_):
"""
Returns all primary keys for given declarative class.