Ignore that last message--it looks like all sacommand's create() does
is:

    print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
    bind_meta_data()
    get_model()
    metadata.create_all()

so, I did a tg-admin shell, bound the metadata, did a from foo.model
import *, and then a metadata.create_all() and still nothing.  I'm not
sure if this is an Elixir problem or a TG problem though...

On Nov 2, 9:15 pm, n-org <[EMAIL PROTECTED]> wrote:
> To reply to myself with a little more info, it looks like in
> TurboGears's util.py, get_model() does a
> package = __import__(package_name, {}, {}, ["model"])
>
> I'm not quite if if this will do the equivalent of a "from model
> import *".  As I read the python docs, it should, so I'm not sure why
> it isn't working.
>
> Also, I moved to 1.0.4b1 and still see the same problem.
>
> Thanks again
>
> On Nov 2, 4:38 pm, n-org <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I'm trying to get TG & Elixir going in my project.  It was working
> > correctly when I had a simple model.py, but I split my model into a
> > few files and it isn't working.  My guess is there's something I need
> > to declare so that it finds where I've put my model files.
>
> > Some details:
>
> > -> I'm running TG 1.0.3.2, SA 0.3.10, Elixir 0.3
>
> > -> I had a working model.py which I split into several files
> > model/foo.py
> > model/bar.py
> > etc
>
> > -> My model/__init__.py contains:
>
> > from turbogears.database import metadata
>
> > metadata.bind = 'postgres://postgres:[EMAIL PROTECTED]:5432/project'
>
> > __all__ = ['foo', 'bar']
>
> > -> When I run "tg-admin sql create"
> > it prints:
> > Creating tables at postgres://postgres:[EMAIL PROTECTED]:5432/project
>
> > But no tables are created in the DB
>
> > -> I was using tg-admin shell; create_all() to create my model.  That
> > doesn't work either.  So, there may be two problems (Elixir and tg-
> > admin sql create AND the problem with splitting into multiple files)
>
> > -> In the header of each model file, I have
> > from turbogears.database import session
>
> > which seemed necessary to get the db session before I define any
> > Entities.
>
> > Any ideas?
>
> > Thank you so much!  Other than this, I'm really enjoying TG & Elixir.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to