Jonathan,
I did originally create the project using tg-admin quickstart, but
this did not create the database; to do this it was necessary to use
"tg-admin sql create."
As the project has developed I have rerun "tg-admin sql create".many
times to re-create the database after model changes with no problems.
When I upgraded to the latest 0.52 version of Elixir (for the bug fix
when passing name in constraint_kwargs) this stopped working.
When I go back to Elixir 0.4.0.dev_r209 it works again.
Under 0.52 I have tried the various options :
- "elixir.options_defaults['autosetup'] =
True" at the top of my model.py
-
"elixir.setup_all()"
at the end
-
"turbogears.startup.call_on_startup.append(elixir.setup_all)"
at the end
as recommended by Jason, none of which seem to make any difference.
If I try manually running elixir.setup_all() followed by
elixir.create_all() in "tg-admin shell" I get the following error:
**************************************************************************************************************************************************************
<class 'sqlalchemy.exceptions.InvalidRequestError'>Traceback (most
recent call last)
Y:\trunk\<ipython console> in <module>()
c:\python25\lib\site-packages\elixir-0.5.2-py2.5.egg\elixir
\__init__.py in create_all(*args, **kwargs)
97 '''Create the necessary tables for all declared
entities'''
98 for md in metadatas:
---> 99 md.create_all(*args, **kwargs)
100
101
C:\Python25\lib\site-packages\sqlalchemy-0.4.0beta5-py2.5.egg
\sqlalchemy\schema.py in create_all(self, bind, tables, checkfirst)
1204
1205 if bind is None:
-> 1206 bind = self._get_bind(raiseerr=True)
1207 bind.create(self, checkfirst=checkfirst,
tables=tables)
1208
C:\Python25\lib\site-packages\sqlalchemy-0.4.0beta5-py2.5.egg
\sqlalchemy\schema.py in _get_bind(self, raiseerr)
1229 if not self.is_bound():
1230 if raiseerr:
-> 1231 raise exceptions.InvalidRequestError("This
SchemaItem is not connected to any Engine or Connection.")
1232 else:
1233 return None
<class 'sqlalchemy.exceptions.InvalidRequestError'>: This SchemaItem
is not connected to any Engine or Connection.
**************************************************************************************************************************************************************
Does this shed any further light?
Thanks for your help,
Tim
On Apr 16, 2:18 pm, Jonathan LaCour <[EMAIL PROTECTED]>
wrote:
> Dr.T wrote:
> > I'm running 1.1 (1.1b1dev_r3505), because I need to use Oracle as
> > a back end, which led me to choose SQLAlchemy + Elixir and thought
> > this and Genshi would ease migration later.
>
> Did you generate your project using the `quickstart` command
> provided by TurboGears? If so, and it generated the database code,
> this is likely a bug in TurboGears 1.1. If not, you've probably
> done something differently than how they expect in order to discover
> all of the tables they need to create. You might need to use their
> metadata, for example.
>
> Until we know more, we really can't help you out. Best of luck!
>
> --
> Jonathan LaCourhttp://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---