Changes between Version 1 and Version 2 of Ticket #29340, comment 5


Ignore:
Timestamp:
Apr 20, 2018, 6:31:29 AM (6 years ago)
Author:
hematinik

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29340, comment 5

    v1 v2  
    22> The extra queries are caused by accessing `event.location` which isn't cached. You could cache that as well using `Event.objects.select_related('location')`. Next time, please use [wiki:TicketClosingReasons/UseSupportChannels our support channels] if you need help confirming whether or not Django is at fault.
    33
    4 Sir I believe you didn't get my point. these two block of code should work just alike while they don't when certain conditions meet:
     4Sir I believe you didn't get my point. these two blocks of code should work just alike while they don't when certain conditions meet:
    55
    66{{{
     
    2828}}}
    2929
    30 I've already cached the values of **event.location** so {{{get_or_set()}}} shouldn't make any sql queries. both of the variations are working fine outside of the loop but they behave differently when used inside a {{{for}}} loop. In sorry for the inconvenience if I'm mistaken.
     30I've already cached the values of **event.location** so {{{get_or_set()}}} shouldn't make any sql queries. both of the variations are working fine outside of the loop but they behave differently when used inside a {{{for}}} loop. I'm sorry for the inconvenience if I'm mistaken.
Back to Top