Ask Your Question

Turn off auto-evaluate in debugger?

asked 2020-06-30 10:05:29 -0600

Chris Curvey's avatar

updated 2020-07-01 21:32:06 -0600

Is there a way to tell Wing not to auto-evaluate a variable in the debugger? Here's my use case: I have a complicate Django ORM query....something like this:

my_results = Foo.objects.filter(....)

And I'm apparently getting a very bad query plan when I execute it. So what I want to do is set a breakpoint and look at my_results.query, but as soon as I type

>>> my_results

Wing stops. I'm assuming it is trying to evaluate the value of my_results so that it can help with auto-completion, but it's actually causing the underlying query to execute.

UPDATE: I think I have a little workaround. If I type str(my_results.query) into a text editor, then copy-and-paste that into the debug console, I get my SQL.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-30 11:06:40 -0600

In this case, you probably want to toggle auto-completion to off in the shell via the Options menu. Trying to get the attributes of the object is probably triggering the underlying query.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-30 10:05:29 -0600

Seen: 323 times

Last updated: Jul 01 '20