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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Chris Curvey's avatar
246
Chris Curvey
asked 4 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 4 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 4 years ago
link

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)