def has_unaccent(cr):
 cr.execute("SELECT proname FROM pg_proc WHERE proname='unaccent'")
 return (len(cr.fetchall()) > 0)

def has_unaccent ( cr ) : cr . execute ( "SELECT proname FROM pg_proc WHERE proname='unaccent'" ) return ( len ( cr . fetchall ( ) ) > 0 )
test if the database has an unaccent function .