Hi all,

I have this in my model.py
        def recipe_cost(self):

                total = IngredientInfo.objects.filter(recipe =
self.id).aggregate(Sum('total')).values()

                return total

Then in my admin.py I call that to display the cost.
        class RecipeAdmin(admin.ModelAdmin):
                list_display = ('title','recipe_cost')

I can see the cost but it's being returned like this:
        [Decimal('500.00')]

But obviously I'd just want the value 500. What should I change?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to