Re: finding the source of "interesting" SQL queries

2012-10-25 Thread Marty Woodlee
Good point, and I agree, allowing the user to use their own cursor wrappers is probably the best solution. At least, it would allow us to avoid the monkeypatching we're having to use here. From there, this particular wrapping could just turn into a django-snippet. I'll try to work on something

Re: finding the source of "interesting" SQL queries

2012-10-25 Thread Anssi Kääriäinen
On 25 loka, 17:52, Marty Woodlee wrote: > Yeah, I don't think we'd try to do anything like that in our actual Django > patch... the THREADLOCALS thing has worked well for us but I realize that's > a pretty big shift to impose on others. If anything I think the patch might > simply modify the exist

Re: finding the source of "interesting" SQL queries

2012-10-25 Thread Marty Woodlee
Yeah, I don't think we'd try to do anything like that in our actual Django patch... the THREADLOCALS thing has worked well for us but I realize that's a pretty big shift to impose on others. If anything I think the patch might simply modify the existing CursorDebugWrapper to add the traceback-ba

Re: finding the source of "interesting" SQL queries

2012-10-24 Thread Àlex Pérez
You are modifying the settings on runtime , that practise is not recommended by django and personally i have had bad experience with that... El 24/10/2012 00:26, "Marty Woodlee" escribió: > So the straw man solution we've implemented for now looks like this. > (Background: we have a settings.THRE

Re: finding the source of "interesting" SQL queries

2012-10-23 Thread Marty Woodlee
So the straw man solution we've implemented for now looks like this. (Background: we have a settings.THREADLOCALS construct which serves in a capacity similar to Ned's global requests; also, our monkeypatch_method decorator does what you probably think it does.) First, we've a tiny bit of middl

Re: finding the source of "interesting" SQL queries

2012-10-22 Thread Matt McClure
Thanks, Russell. That's similar to the approach we were thinking of implementing. Hopefully we'll have a straw man to share shortly. Matt -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://g

Re: finding the source of "interesting" SQL queries

2012-10-22 Thread Russell Keith-Magee
Hi Matt, I'm not aware of any community maintained solution for this. However, interestingly, what you've suggested (including some contextual stack information in a query comment) is something that was suggested by Cal Henderson at the very first DjangoCon. I'm not sure Ned's "global request obj