#NEWLINE# def filter_include_ips( self , queryset , value ) : #NEWLINE# #INDENT# 'Converts ``include_ips`` to queryset filters.' #NEWLINE# include_ips = qpbool ( value ) #NEWLINE# include_networks = qpbool ( self . form . cleaned_data [ 'include_networks' ] ) #NEWLINE# if ( not all ( [ include_networks , include_ips ] ) ) : #NEWLINE# #INDENT# if include_ips : #NEWLINE# #INDENT# return queryset . filter ( is_ip = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return queryset . exclude ( is_ip = True ) #NEWLINE# #UNINDENT# #UNINDENT# return queryset