On 28 sep, 16:15, mdipierro <[email protected]> wrote:
> There are two issues:
> 1) sharing database
> 2) sharing the model
>
> 1) definitively possible just make the two URIs point to the same
> database
>
> 2) also possible but really depends on the detail.
>
> one way to do is to create a function in a module that given a db,
> defines the common tables. You can import that function in multiple
> apps and pass distinct db connections pointing to the same database.
>
> Anyway this break the web2py principle that apps should be autonomous.
> would simply replicate the model file in the two apps. in this way
> each of them can exist without the other. If they do need each other
> than they are not two distinct apps.
create two symlinks:
1) in app2/models:
% ln -s ../../app1/models/db.py db.py
2) 1) in app2:
% ln -s ../app1/databases databases
So far it works well. What he sees drawbacks to this approach?
Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---