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!

enter image description here

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. enter image description here enter image description here

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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -