#NEWLINE# def get_default_odm_query( self ) : #NEWLINE# #INDENT# base_query = ( Q ( 'is_deleted' , 'ne' , True ) & Q ( 'is_registration' , 'eq' , True ) ) #NEWLINE# user = self . request . user #NEWLINE# permission_query = Q ( 'is_public' , 'eq' , True ) #NEWLINE# if ( not user . is_anonymous ( ) ) : #NEWLINE# #INDENT# permission_query = ( permission_query | Q ( 'contributors' , 'eq' , user . _id ) ) #NEWLINE# #UNINDENT# query = ( base_query & permission_query ) #NEWLINE# return query