Just make sure to include an '__init__.py' in your plugin_datatable
folder.... Then you can have file named whatever you want and import as

/modules/plugin_datatable/
                                       __init__.py
                                       util.py
                                       grid.py

namespace = local_import('plugin_datatable.grid')

newgrid = namespace.Grid()

--
Thadeus




On Fri, Dec 10, 2010 at 7:12 PM, Bruno Rocha <rochacbr...@gmail.com> wrote:

> Sorry, the correct is:
>
>
> /modules/plugin_datatable/
>                                       plugin_datatablex.py
>                                       plugin_datatabley.py
>                                       ...
>
> then I will import this modules at /models/plugin_datatable.py
>
> local_import 
> <http://web2py.com/book/default/docstring/local_import>('plugin_datatable/plugin_datatablex')
>
> *will this work?*
>
>
> 2010/12/10 Bruno Rocha <rochacbr...@gmail.com>
>
> No Problem.
>>
>> I'll put aditional functions in /modules/plugin_datatablex.py
>> plugin_datatabley.py etc..
>>
>> and them import this at my model in models/plugin_datatable.py
>>
>>  ok?
>>
>> 2010/12/10 mdipierro <mdipie...@cs.depaul.edu>
>>
>> I am not sure this is intended. This may create problems for
>>> compilation. Moreover I was planning to reserve this syntax (subfolder
>>> in models) for models that should be executed conditionally.
>>>
>>> If it works good but do not rely on it.
>>>
>>> Massimo
>>>
>>> On Dec 10, 6:21 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
>>> > It will work within a subfolder (I have done it) unless things have
>>> changed
>>> > it will work just fine (and still execute in alphabhetical order)
>>> >
>>> > 1 a_settings.py
>>> > b(folder) ->
>>> > 2   -> a.py
>>> > 3   -> c.py
>>> > 4   -> d.py
>>> > 5 c.py
>>> >
>>> > It should execute correctly in the above order
>>> >
>>> > --
>>> > Thadeus
>>> >
>>> > On Fri, Dec 10, 2010 at 6:06 PM, mdipierro <mdipie...@cs.depaul.edu>
>>> wrote:
>>> > > No. Sorry. The problem is that the more complex we make this the
>>> > > slower it gets.
>>> >
>>> > > On Dec 10, 6:03 pm, Bruno Rocha <rochacbr...@gmail.com> wrote:
>>> > > > Hi,
>>> >
>>> > > > regarding the creation of plugins,
>>> > > > can I have more than one file in /models or /controllers for each
>>> plugin?
>>> >
>>> > > > I tried:
>>> > > > /models/
>>> > > > plugin_datatable.py
>>> > > > plugin_datatable.secondmodel.py
>>> > > > plugin_datatable.thirdmodel.py
>>> >
>>> > > > Also in /controllers
>>> >
>>> > > > But web2py does not execute the files named in this way
>>> > > > plugin_name.anothername.py, and when packing a plugin these files
>>> are
>>> > > not
>>> > > > included in plugin.
>>> >
>>> > > > can I have a folder inside /models or /controllers ?
>>> >
>>> > > > /models/db.py
>>> > > > /models/plugin_datatable/plugindb.py
>>> >
>>> > > > or another way to have more files by plugin?
>>> >
>>> > > > Thank you.
>>> >
>>> > > > --
>>> >
>>> > > > Bruno Rochahttp://about.me/rochacbruno/bio
>>> >
>>> >
>>>
>>
>>
>>
>> --
>>
>> Bruno Rocha
>> http://about.me/rochacbruno/bio
>>
>
>
>
> --
>
> Bruno Rocha
> http://about.me/rochacbruno/bio
>

Reply via email to