#NEWLINE# def pre_add( self , obj ) : #NEWLINE# #INDENT# obj . slug = ( obj . slug . strip ( ) or None ) #NEWLINE# if self . slug : #NEWLINE# #INDENT# obj . slug = obj . slug . replace ( ' ' , '-' ) #NEWLINE# obj . slug = re . sub ( '\\W+' , '' , obj . slug )