#NEWLINE# @ classmethod #NEWLINE# def get_by_endpoint( cls , endpoint , active = True ) : #NEWLINE# #INDENT# query = Q ( 'endpoint' , 'iexact' , endpoint ) #NEWLINE# if cls : #NEWLINE# #INDENT# query &= Q ( 'active' , 'eq' , True ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return Conference . find_one ( query ) #NEWLINE# #UNINDENT# except ModularOdmException : #NEWLINE# #INDENT# raise ConferenceError ( 'Endpoint {0} not found' . format ( endpoint ) )