I import modules from the app all the time. I normally put them in modules/ but it makes no difference if they are in controllers/. I would not do it this way not nothing technically prevents it if you have the __init__.py file.
You can define forms in modules and they will be visible everywehere. You can define them in views if you only need them in views. Voltron is very concerned about doing this as fast as possible, hence they should be in modules so that the pyc are cached by Python. Massimo On May 15, 10:08 am, DenesL <denes1...@yahoo.ca> wrote: > On May 15, 8:57 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Voltron, I do that all the time so something else is wrong. > > Massimo, what is what you do all the time? > import from the controllers folder or import from modules?. > > It seems to me that in web2py's design the controllers folders was not > meant for this, it has never included the requerired __init__.py files > to make it a package. > > And even after you add the __init__.py files you still have to import > from gluon anything that you will use to create your form. > > So the question becomes: is there a location to place forms (or other > code) so they can be imported without having to import all the other > parts from gluon?. If not, should there be one?. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---