First time here? Check out the FAQ!
1

Turn off auto-evaluate in debugger?

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.

Chris Curvey's avatar
246
Chris Curvey
asked 2020-06-30 10:05:29 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2020-07-01 21:32:06 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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.

Wingware Support's avatar
4.2k
Wingware Support
answered 2020-06-30 11:06:40 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer