You can also now do:

db = DAL(..., folder='path/to/app/databases/folder', auto_import=True)

That will automatically define the database models of the external app 
based on the metadata stored in the .table files in the app's /databases 
folder. Note, that will only get you the field names and types, but not the 
web2py specific attributes such as "requires", "represent", "default", etc. 
Could be useful if you just need to do some queries, but maybe not enough 
if you need to create forms.

See 
http://web2py.com/books/default/chapter/29/6#Using-DAL-without-define-tables.

Anthony

On Wednesday, March 21, 2012 10:46:25 AM UTC-4, Detectedstealth wrote:
>
> I have multiple applications. I have been moving more of my code into 
> modules which defines tables that both applications may use. You can import 
> a module in one application from a different application. There have been 
> quite a few examples of this now.
>
> My system currently has 4 applications and 3 databases.
>
> --
> Regards,
> Bruce
>
> On Wed, Mar 21, 2012 at 7:39 AM, n1ck <hhh...@gmail.com> wrote:
>
>> Hmmmmm.... I see, so if you are building a system you just create
>> single application, right?
>>
>> On Mar 21, 10:16 pm, Cliff <cjk...@gmail.com> wrote:
>> > I have done what you want to do, but I won't do it again.  Too
>> > complicated keeping the different versions of the model in synch.
>> >
>> > Also there are migration issues--
>> >
>> > Consider putting everything into a single application.
>> >
>> > Check out this link:
>> http://web2py.com/book/default/chapter/04#Cooperation
>> >
>> > Bruno Rocha has also posted a no-model approach that you might try.
>> >
>> > On Mar 21, 8:58 am, n1ck <hhh...@gmail.com> wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > I have two different application then I want to call the db/model from
>> > > another application,
>> > > how can I do that?
>>
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  

Reply via email to