def getById(partyId): parties = Party.getById(partyId) return Subscription.objects.filter(partyId__in=parties)
def getByIdAndPartner(partyId, partnerId): parties = Party.getById(partyId) return UsageUnitPurchase.objects.filter(partyId__in=parties) \ .filter(partnerId=partnerId) \