def METHOD_NAME(self):
    if hasattr(self, "_memberships"):
        return self._memberships
    parties = self.get_parties()
    candidates_for_party = (
        self.ballot_paper.local_area.membership_set.filter(
            party__in=parties
        )
        .select_related("person")
        .order_by("pk")
    )
    self._memberships = candidates_for_party
    return self._memberships