Re: [web2py] Re: web2py with Eclipse

2011-06-27 Thread Sebastian E. Ovide
That's it !

thanks

On Mon, Jun 27, 2011 at 1:16 AM, Pierre Thibault pierre.thibau...@gmail.com
 wrote:

 from applications.soso.models.some_module import my_db_helper_here

 I'm sorry I forgot the some_module in my first example.




-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Pierre Thibault
2011/6/26 sebastian sebastianov...@gmail.com

 what about the functions defined in the models ? (global functions)



Pydev won't see them because they are imported implicitly by web2py. You can
use the if 0: trick so the static code analyzer will not complain:

if 0:
  from applications.myapp.models import myfunc

In the preferences of Pydev you can make if fold-able to be able to fold
the noisy code: Window  Preferences  Pydev  Editor  Folding

There is not much you can do because this is not a standard way to do things
in Python. Breaking from the standard has his part of ugly.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Sebastian E. Ovide
Thanks Pierr,

I was trying to do that but it is not working... actually I have a bunch of
imports insede that if 0 trick that solve all the web2py dependencies
errors...

the only errors stil there are those due to functions in my model files (as
for example the models of my plugins)

I've tried also

from applications.myapp.models import *

and added a __init__.py inside the models folder

any other ideas ?


On Sun, Jun 26, 2011 at 8:39 PM, Pierre Thibault pierre.thibau...@gmail.com
 wrote:


 if 0:
   from applications.myapp.models import myfunc




-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Sebastian E. Ovide
add info:

from applications.soso.models import my_db_helper_here

eclipse give this error:

Unresolved import: my_db_helper_here
Unused import: my_db_helper_here

On Sun, Jun 26, 2011 at 11:43 PM, Sebastian E. Ovide 
sebastian.ov...@gmail.com wrote:

 Thanks Pierr,

 I was trying to do that but it is not working... actually I have a bunch of
 imports insede that if 0 trick that solve all the web2py dependencies
 errors...

 the only errors stil there are those due to functions in my model files (as
 for example the models of my plugins)

 I've tried also

 from applications.myapp.models import *

 and added a __init__.py inside the models folder

 any other ideas ?



 On Sun, Jun 26, 2011 at 8:39 PM, Pierre Thibault 
 pierre.thibau...@gmail.com wrote:


 if 0:
   from applications.myapp.models import myfunc




 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Pierre Thibault
2011/6/26 Sebastian E. Ovide sebastian.ov...@gmail.com

 add info:

 from applications.soso.models import my_db_helper_here

 eclipse give this error:

 Unresolved import: my_db_helper_here
 Unused import: my_db_helper_here


Is the web2py folder in your path?

I guess you are missing a level. Try something like:

from applications.soso.models.some_module import my_db_helper_here

I'm sorry I forgot the some_module in my first example.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-20 Thread Pierre Thibault
2011/6/20 weheh richard_gor...@verizon.net

 Hi Pierre, I've read your excellent pages and followed your
 instructions before, to good effect. Of course, the downside is that
 one ends up with a lot of junk code in the beginning of one's files. I
 was under the impression that the latest version of web2py bypassed
 all that with a simple 1-liner: from gluon import *  but this doesn't
 seem to be the case as it doesn't work for me. Hence, my question and
 this thread. Thanks for the quick response!



Thank you Weheh. This is the best solution I know for working with Pydev and
web2py. Definitively not perfect.

The good news is that it seems that the Pydev team is working on something
to improve the support of web2py:
http://groups.google.com/group/web2py/browse_thread/thread/38784ca3ebf3bbb0/aeded9d3cab7c468?lnk=gstq=pydev#aeded9d3cab7c468

We can hope for the best.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-20 Thread Anthony
Massimo suggested this recently: 
https://groups.google.com/d/msg/web2py/z-ckQANc9PY/-tGhBE6oxYMJ

On Monday, June 20, 2011 2:14:47 AM UTC-4, Pierre Thibault wrote:

 2011/6/20 weheh richard...@verizon.net

 Hi Pierre, I've read your excellent pages and followed your
 instructions before, to good effect. Of course, the downside is that
 one ends up with a lot of junk code in the beginning of one's files. I
 was under the impression that the latest version of web2py bypassed
 all that with a simple 1-liner: from gluon import *  but this doesn't
 seem to be the case as it doesn't work for me. Hence, my question and
 this thread. Thanks for the quick response!



 Thank you Weheh. This is the best solution I know for working with Pydev 
 and web2py. Definitively not perfect.

 The good news is that it seems that the Pydev team is working on something 
 to improve the support of web2py: 
 http://groups.google.com/group/web2py/browse_thread/thread/38784ca3ebf3bbb0/aeded9d3cab7c468?lnk=gstq=pydev#aeded9d3cab7c468

 We can hope for the best.


 -- 


 A+

 -
 Pierre
 My blog and profile 
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2



Re: [web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-20 Thread Pierre Thibault
2011/6/20 weheh richard_gor...@verizon.net

 @Anthony, Unfortunately, this code from the other thread does not work
 for my Eclipse installation:

 if 0:
from gluon.dal import DAL
from gluon.tools import Auth
db = DAL()
auth = Auth()


 The only thing that has worked so far is Pierre's implementation,
 which is (no offense) unbelievably ugly (but effective).


To ease things, it is possible to make if fold-able: Window  Preferences 
Pydev  Editor  Code folding  Fold if statements. Then you click in the
gutter to reduce in only one line.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse

2011-05-10 Thread Sebastian E. Ovide
yes, I'm using that trick and it is working fine... except in the views

On Tue, May 10, 2011 at 5:52 PM, Ross Peoples ross.peop...@gmail.comwrote:

 The only thing that had really worked for me in the past was doing the if
 0: trick:

 if 0:
 from gluon.dal import DAL
 from gluon.tools import Auth
 db = DAL()
 auth = Auth()

 The code won't actually get executed, it's just there to give Eclipse and
 other IDE's some direction.

 If this still doesn't work, then you'll have to wait until the next web2py
 release, which could be in a week or two.




-- 
Sebastian E. Ovide