I'm seeing some usual goings on in my application. For no reason my server slows down when I have little or no traffic. After lots of trial and error I found my problems disappeared when I removed the ToOneField
on my TastyPie resource!
What I found was for some unknown reason TastyPie is doing DB UPDATES on these ToOneFields for no good reason! What the... moment!
I found a possible bug filed here which claims to have fixed the update issue. I have installed the latest version from pip
but still see this problem.
Can anyone help?
class IncentiveResource(ModelResource):
product_introducer = fields.ToOneField(ProductResource, 'referrer_product', full=True)
product_friend = fields.ToOneField(ProductResource, 'referee_product', full=True)
class Meta:
queryset = Incentive.objects.all().order_by('-date_created')
resource_name = 'incentive'
allowed_methods = ['get']
authentication = MultiAuthentication(ClientAuthentication(), ApiKeyAuthentication())
authorization = Authorization()
filtering = {
"active": ALL,
}
always_return_data = True
cache = SimpleCache(cache_name='resources', timeout=10)
So little traffic here but becomes unusable.