def delete_typeattr(typeattr,**kwargs):
    """
        Remove an typeattr from an existing type
    """

    tmpltype = get_templatetype(typeattr.type_id, user_id=kwargs.get('user_id'))

    ta = db.DBSession.query(TypeAttr).filter(TypeAttr.type_id == typeattr.type_id,
                                          TypeAttr.attr_id == typeattr.attr_id).one()

    tmpltype.typeattrs.remove(ta)

    db.DBSession.flush()

    return 'OK'
def delete_typeattr ( typeattr , ** kwargs ) : tmpltype = get_templatetype ( typeattr . type_id , user_id = kwargs . get ( 'user_id' ) ) ta = db . DBSession . query ( TypeAttr ) . filter ( TypeAttr . type_id == typeattr . type_id , TypeAttr . attr_id == typeattr . attr_id ) . one ( ) tmpltype . typeattrs . remove ( ta ) db . DBSession . flush ( ) return 'OK'
Remove an typeattr from an existing type