A "package" is a path with __init__.py.
So if you want to include "applcations.yourapp.controllers.something",
all of these paths (applications, applications/yourapp,
applications/yourapp/welcome and
applications/yourapp/welcome/controllers) must have __init__.py empty
(generally...) file inside.
So, create __init__.py in applications/yourapp/controllers AND in
applications/yourapp/controllers/forms (you have __init__, not
__init__.py). So you can do:
import applications.yourapp.controllers.forms.reg_form as reg_form
--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/
You are missing .py on the __init__, was that a typo?
> import forms.reg_form ### ERROR
Since web2py runs out of it's root maybe (this as worked for me with
things out of my modules directory):
import applications.appName.controllers.forms.reg_form
I still use Web2py for one domain, its just that my boss was not too
happy with the problems we had deploying the web2py applications
(CherryPY server not scaling, FCGI). We are using a PHP framework for
those domains( 3) instead
I don't understand why you can't import them.
I just modified welcome app (from trunk) and it works very well for
me, like I stated before:
----- cut here -----
So, create __init__.py in applications/yourapp/controllers AND in
applications/yourapp/controllers/forms (you have __init__, not
__init__.py). So you can do:
import applications.yourapp.controllers.forms.reg_form as reg_form
----- cut here -----