This sounds to me like another advantage to having database "modes" that are being discussed in other threads. Once the debugging view begins, it could switch the db connection into a non-committal mode, so the existing QuerySets don't actually touch anything.
-Gul On 8/29/07, George Vilches <[EMAIL PROTECTED]> wrote: > > Jeremy Dunck wrote: > > On 8/28/07, George Vilches <[EMAIL PROTECTED]> wrote: > > ... > >> Something seems very wrong about this situation, that debugging could > >> cause another query to execute (especially an unintended query), but I > >> don't know what the correct way to go about fixing or preventing it. > >> I've tried a bunch of things to stop the QuerySets from evaluating when > >> the local vars are being printed, but haven't been able to come up with > >> anything much. Is there a good way to prevent this issue in the 500 > >> template? > > > > As a ham-handed fix, django.views.debug, where it pushes the frame > > locals into 'vars' , could remove instances of queryset. > > Alternatively, it could substitute the generated sql for the queryset > > itself. > > I looked at the possibility of both of those fixes, and they seem > doable, but they would require adding special handler code just for > QuerySets (especially the one to get the SQL generated code instead of > the QuerySet). I think I agree with your ham-handed phrase there. > > That having been said, would a fix like that even get into Django? > Doesn't sound very Django-ish. I'll do the work, but I'm really hoping > someone can point me in the direction of what a proper Django solution > is, I would highly prefer not to have to keep patching this with an ugly > QuerySet workaround that won't get accepted into trunk. > > I feel this problem might have far-reaching consequences as more people > migrate large existing projects onto Django. Often, people have tricks > to turn on debugging for certain users/IPs in production, and this could > totally tank a production site if the large dataset issue described > previously was encountered. > > George > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
