Yes, he need something like Yii2 modules (http://www.yiiframework.com/doc-2.0/guide-structure-modules.html) or Symfony2 bundles (http://symfony.com/doc/2.0/cookbook/bundles/best_practices.html), I think that something like that can be a good feature for web2py, not just for the specific Dominic use case, but will be a huge jump for build big apps and will improve the code reutilization.

Greetings.

El 22/06/16 a las 09:04, Anthony escribió:
Sorry, I misread your proposal -- I think you meant that the /wrapper/ would be the plugin. That still has problem #1 below, and if you strictly follow the plugin naming convention, it won't work, as the model file would start with "plugin_", which will not necessarily be the first model file to run. But again, it's the right idea -- it should just be done without the formality of being a plugin.

Anthony

On Wednesday, June 22, 2016 at 9:00:12 AM UTC-4, Anthony wrote:

    On Wednesday, June 22, 2016 at 8:28:01 AM UTC-4, Carlos Cesar
    Caballero wrote:

        Hi guys, maybe I am missing something in the discussion, but,
        why not use plugins to achieve that? you can write the
        "wrapper" code in a model, and clients/users can
        install/remove/update it via the web2py plugin system.


    Sure, though there are some problems:

     1. I don't think this approach completely satisfies Dominic's
        requirements, as he wants the wrapper to be external to the
        application folder of the wrapped application (I don't think
        this is an important requirement, but there it is).
     2. Developing an entire application as a plugin can be a bit
        unnatural (if strictly following the rules) -- all files,
        object names, and session variables must start with plugin_[name].
     3. From the perspective of the admin app, a single plugin can
        only have one model file and one controller file (because of
        the plugin_[name].py naming convention), so you would need to
        break it up into multiple plugins. (Note, I think this only
        affects packing via admin as well as the way you navigate
        plugin files in admin -- I believe you can successfully unpack
        a plugin regardless of the filenames it contains.)

    Anyway, one of my suggestions was basically to take this same
    approach without the formality of the plugins_[name] naming
    convention. The idea was to create a shell application with a
    single model file (named so it would be ensure to run first), and
    then just copy/unzip the real application on top of that shell.
    This is the same idea as a plugin, just without following the
    naming scheme.


    Anthony

--
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 the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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 the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to