1
If I want to get all of the communities associated with a team
#you just need to use the M2M field
communities = team.communities.all()
#If you want CommunityMemberships instead
community_memberships = team.communitymembership_set.all()
Source:stackexchange.com