#NEWLINE# def get_relation_count_query( self , query , parent ) : #NEWLINE# #INDENT# '\n        Add the constraints for a relationship count query.\n\n        :type query: orator.orm.Builder\n        :type parent: orator.orm.Builder\n\n        :rtype: orator.orm.Builder\n        ' #NEWLINE# if ( parent . get_query ( ) . from__ == query . get_query ( ) . from__ ) : #NEWLINE# #INDENT# return self . get_relation_count_query_for_self_join ( self , parent ) #NEWLINE# #UNINDENT# self . _set_join ( query ) #NEWLINE# return super ( BelongsToMany , self ) . get_relation_count_query ( query , parent )