def _get_filter_query(args):
 query = Q()
 for arg in args:
  if (hasattr(Document, arg) and args[arg]):
   append = Q(**{str((('document__' + arg) + '__id')): long(args[arg])})
   append = (append | Q(**{str((('file__' + arg) + '__id')): long(args[arg])}))
   append = (append | Q(**{str((('weblink__' + arg) + '__id')): long(args[arg])}))
   query = (query & append)
 return query

def _get_filter_query ( args ) : query = Q ( ) for arg in args : if ( hasattr ( Document , arg ) and args [ arg ] ) : append = Q ( ** { str ( ( ( 'document__' + arg ) + '__id' ) ) : long ( args [ arg ] ) } ) append = ( append | Q ( ** { str ( ( ( 'file__' + arg ) + '__id' ) ) : long ( args [ arg ] ) } ) ) append = ( append | Q ( ** { str ( ( ( 'weblink__' + arg ) + '__id' ) ) : long ( args [ arg ] ) } ) ) query = ( query & append ) return query
creates a query to filter identities based on filterform arguments .