Ask Your Question
1

Turn off auto-evaluate in debugger?

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

Chris Curvey gravatar image

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

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
0

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

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

2 followers

Stats

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

Seen: 65 times

Last updated: Jul 01