def resolve_fulfilled_by(self, args, context, info): events = self.fulfillment_events.all() fulfillments = [] for event in events: fulfill = FulfillmentProxy( fulfilled_by=event, fulfills=self, fulfilled_quantity=QuantityValueProxy( numeric_value=event.quantity, unit=event.unit_of_quantity), ) fulfillments.append(fulfill) return fulfillments
def resolve_fulfills(self, args, context, info): commitment = self.commitment if commitment: fulfillment = Fulfillment( fulfilled_by=self, fulfills=commitment, fulfilled_quantity=QuantityValueProxy( numeric_value=self.quantity, unit=self.unit_of_quantity), ) ff_list = [] ff_list.append(fulfillment) return ff_list return []
def resolve_fulfilled_by(self, args, context, info): events = self.fulfillment_events.all() request_distribution = args.get('request_distribution') if request_distribution != None: events = events.filter(is_contribution=request_distribution) fulfillments = [] for event in events: fulfill = FulfillmentProxy( fulfilled_by=event, fulfills=self, fulfilled_quantity=QuantityValueProxy(numeric_value=event.quantity, unit=event.unit_of_quantity), ) fulfillments.append(fulfill) return fulfillments
def resolve_affected_quantity(self, args, *rargs): return QuantityValueProxy(numeric_value=self.quantity, unit=self.unit_of_quantity)
def resolve_transfer_quantity(self, args, *rargs): return QuantityValueProxy(numeric_value=self.actual_quantity(), unit=self.unit)
def resolve_current_quantity(self, args, *rargs): return QuantityValueProxy(numeric_value=self.quantity, unit=self.unit)
def resolve_committed_quantity(self, context, **args): #args, *rargs): return QuantityValueProxy(numeric_value=self.quantity, unit=self.unit_of_quantity)