python - How can I stop TastyPie doing UPDATE queries for no reason? -
i'm seeing usual goings on in application. no reason server slows down when have little or no traffic. after lots of trial , error found problems disappeared when removed toonefield
on tastypie resource!
what found unknown reason tastypie doing db updates on these toonefields no reason! the... moment!
i found possible bug filed here claims have fixed update issue. have installed latest version pip
still see problem.
can 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 becomes unusable.
i don't know if you, i've seen slight performance increase in app worked on while using select_related
in queryset , full=true
in resource field.
try queryset = incentive.objects.select_related('product_introducer', 'product_friend').all().order_by('-date_created')
Comments
Post a Comment