def get_customer_points_total(self, customer):
cache = getattr(self, '_total_points_cache', {})
if customer.id not in cache:
cache[customer.id] = customer.customerpoints_set.total()
self._total_points_cache = cache
return cache[customer.id]
CustomerAdmin.get_customer_points_total = get_customer_points_total