Feature request. Django Console disconnect

Hi all,

For all its bugginess I really like the new Django Console.  I noticed there are two menu buttons.  The close window button and the stop button.  The stop button is completely pointless b/c when you stop it there is nothing to do but close the window (you can't recover from it), and if you close the window it is stopped. So...  Could you change the stop button to be simply a disconnect.  Effectively doing this.


        from django.db import connections, DEFAULT_DB_ALIAS

        connection = connections[DEFAULT_DB_ALIAS]

        connection.close()

This way you can keep the session going.
6 comments
Comment actions Permalink

So why exactly this is useful? Maybe it's better to simply drop the "stop" button?

0
Comment actions Permalink

Maybe it is better to assign 'Stop last command' action to that button? Now it is mapped to Ctrl+C and not
very obvious.

0
Comment actions Permalink

OK - So "Disconnect" is useful because I don't want to type it.. LOL.

Think about the django developers workflow.

  1. ./manage.py reset <app> (If in midstream or syncdb) - This is defined as a configuration in pycharm.
  2. Work on models - Refine them.
  3. Bring up the console to run queries test views etc.
  4. If something needs changing goto #1

But if I have the console open, and I was running and Query "./manage.py reset" or "./manage.py syncdb" will not proceed as there is an open connection.  If I had a convienient way to close the connection then I wouldn't loose my queries, I could retry them later as the console is no longer dead.

Thanks for listening!!

0
Comment actions Permalink

Looks like it would be even more useful if PyCharm automatically prompted you to close the connection when you run one of those manage.py tasks from within PyCharm.

0
Comment actions Permalink

Now THAT would be useful!  Don't kill kill it - just close the connect.  If you kill it then you loose all your history!

0

Please sign in to leave a comment.