IS there a build in function to filter a many-to-many relationship or should i write a custom query for this. If so what would be best practice?