importing model in lib files

0 views
Skip to first unread message

martin.s...@gmail.com

unread,
Mar 13, 2008, 2:12:07 PM3/13/08
to pylons-discuss
Hello, i have small problem again :)

I want import model file (db.py in /model) into lib file (/lib/
file.py) .. but import myproject.model.db not work :(

Pleas, where is the problem ?

Thanks

Jose Galvez

unread,
Mar 13, 2008, 8:43:43 PM3/13/08
to pylons-...@googlegroups.com
in your __init__.py file in your model folder first add import db and
see if that helps

Mike Orr

unread,
Mar 13, 2008, 10:37:32 PM3/13/08
to pylons-...@googlegroups.com
Try in "paster shell development.ini":

import myproect.model
import myproject.model.db
frm myproject model import db

If they all fail, make sure myproject/model/db.py exists. If the
first works. the others should too.

Importing db into model solves a different problem: it allows you to
use db by just importing model, without having to import db
separately. That's a matter of taste.

--Mike

--
Mike Orr <slugg...@gmail.com>

Reply all
Reply to author
Forward
0 new messages