def delete_namespace_content(context, namespace_id, session):
 count = 0
 query = session.query(models.MetadefObject).filter_by(namespace_id=namespace_id)
 count = query.delete(synchronize_session='fetch')
 return count

def delete_namespace_content ( context , namespace_id , session ) : count = 0 query = session . query ( models . MetadefObject ) . filter_by ( namespace_id = namespace_id ) count = query . delete ( synchronize_session = 'fetch' ) return count
use this def only if the ns for the id has been verified as visible .