I just found "auto_import" that is great!

db = DAL('mysql://user:pass@localhost
/datab',folder='path_to/applications/myapp/databases',auto_import=True)

Works great!



On Fri, Feb 13, 2015 at 3:24 PM, Tito Garrido <titogarr...@gmail.com> wrote:

> Hi Folks!
>
> I am working on a project that will require some celery tasks and I would
> like to use pydal to manage the tables created on web2py.
>
> So an example, a simple tw clone... that would use auth_user table +
> references
>
> db.define_table('tweet',
>     Field('user_id', 'reference auth_user'),
>     Field('post', 'text', requires=IS_NOT_EMPTY()),
>     Field('created_on', 'datetime', default=request.now),
>     )
>
> db.define_table('follow',
>     Field('follower', 'reference auth_user'),
>     Field('following', 'reference auth_user'),
>     Field('created_on', 'datetime', default=request.now),
>     )
>
> How could I use pydal out of web2py? I wouldn't like to maintain 2 db.py
> files... I mean is there a way to make pydal read db.py from web2py and
> avoid double "define_table" statements?
>
> Regards,
>
> Tito
>
>
> --
>
> Linux User #387870
> .........____
> .... _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:_______
>



-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to