'I\'m special casing this because we use purchase_ids a lot in the site
and we are not caching empty querysets in cache-machine.
That means that when the site is first launched we are having a
lot of empty queries hit.
We can probably do this in smarter fashion by making cache-machine
cache empty queries on an as need basis.'

def purchase_ids(self):

    from mkt.prices.models import AddonPurchase
    @memoize(prefix='users:purchase-ids')
    def ids(pk):
        return AddonPurchase.objects.filter(user=pk).values_list('addon_id', flat=True).filter(type=mkt.CONTRIB_PURCHASE).order_by('pk')
    return ids(self.pk)
