def weight_for_garden(self): """Convert weight to proper units for garden.""" if self.garden: return to_preferred_weight_units(self.weight.value, self.garden, force_large_units=False) else: return to_weight_units(self.weight.value, 'imperial', force_large_units=False)
def get_food_pounds(self): grams = Harvest.objects.aggregate(grams=Sum('weight'))['grams'] return round(to_weight_units(grams, 'imperial').magnitude)
def get_compost_pounds(self): grams = CompostProductionWeight.objects.aggregate( grams=Sum('weight'))['grams'] return round(to_weight_units(grams, 'imperial').magnitude)
def get_compost_pounds(self): grams = CompostProductionWeight.objects.aggregate(grams=Sum('weight'))['grams'] return round(to_weight_units(grams, 'imperial').magnitude)