Cheap trick to achieve intellisense/autocompletion

132 views
Skip to first unread message

Andrew Buchan

unread,
Dec 10, 2014, 7:52:29 AM12/10/14
to web...@googlegroups.com
Hi all,

I've found a way to get code completion on global objects such as request, response and db (with all your table definitions and fields!) in IDEs which provide code completion.
I've been using this for a while now and have to say it really does speed up my web2py development, so thought I'd finally tidy it up a bit and share it.

Here's what you'd get on all your tables:

        db..
        db.my_table..
        db.my_table.my_field..
        db.my_table.my_field.represent













Source is here:


Enjoy!

Alex

unread,
Dec 15, 2014, 3:41:22 PM12/15/14
to web...@googlegroups.com

thanks! seems to work fine so far. You've got a syntax error in line 38: ', is missing at the end.


Alex

Andrew Buchan

unread,
Dec 15, 2014, 3:56:30 PM12/15/14
to web...@googlegroups.com
Excellent, glad someone is using it. Thanks for the heads up on the typo, it's not the version I'm actually using which is why I'll have missed it. Fixed now.
What IDE are you using btw?

On Mon, Dec 15, 2014 at 8:41 PM, Alex <mrau...@gmail.com> wrote:

thanks! seems to work fine so far. You've got a syntax error in line 38: ', is missing at the end.


Alex

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/aQBsDK_TjB0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex

unread,
Dec 15, 2014, 5:04:28 PM12/15/14
to web...@googlegroups.com
I'm using PyCharm Community Edition. I'm planning to upgrade to the Professional Edition (which has web2py support) once they got some annoying bugs fixed. At the moment I don't know how good the web2py support is, i.e. if it makes your db autocomplete script obsolete or not.

Richard Vézina

unread,
Dec 19, 2014, 1:13:26 PM12/19/14
to web2py-users
I do use PyCharm Pro for 2 years now and it generally good, but it has difficulty to resolve vars define in model... I hope they improve web2py support. They have made an effort when they bring web2py support but then it seems that they stop developping for web2py users... Maybe they sell to few licences ??

I really enjoy using PyCharm even if the support is not perfect though

Richard

You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages