#NEWLINE# def __new__( cls , arg ) : #NEWLINE# #INDENT# values = set ( [ c for c in re . split ( '\\s*,\\s*' , ( arg or '' ) ) if c ] ) #NEWLINE# if values . difference ( cls . _allowed_cascades ) : #NEWLINE# #INDENT# raise sa_exc . ArgumentError ( ( 'Invalid cascade option(s): %s' % ', ' . join ( [ repr ( x ) for x in sorted ( values . difference ( cls . _allowed_cascades ) ) ] ) ) ) #NEWLINE# #UNINDENT# if ( 'all' in values ) : #NEWLINE# #INDENT# values . update ( cls . _add_w_all_cascades ) #NEWLINE# #UNINDENT# if ( 'none' in values ) : #NEWLINE# #INDENT# values . clear ( ) #NEWLINE# #UNINDENT# values . discard ( 'all' ) #NEWLINE# self = frozenset . __new__ ( CascadeOptions , values ) #NEWLINE# self . save_update = ( 'save-update' in values ) #NEWLINE# self . delete = ( 'delete' in values ) #NEWLINE# self . refresh_expire = ( 'refresh-expire' in values ) #NEWLINE# self . merge = ( 'merge' in values ) #NEWLINE# self . expunge = ( 'expunge' in values ) #NEWLINE# self . delete_orphan = ( 'delete-orphan' in values ) #NEWLINE# if ( self . delete_orphan and ( not self . delete ) ) : #NEWLINE# #INDENT# util . warn ( "The 'delete-orphan' cascade option requires 'delete'." ) #NEWLINE# #UNINDENT# return self