On 7/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I am a little bit confused by the 'thread-localness' behavior and how
> it relates to the Entity tables and DB connection ( http://tinyurl.com/26gjc3
> ).
This comment was for version 0.2 of Elixir and earlier. This is not
true anymore for version 0.3 and later!
> def process_and_populate():
> # Is it necessary to add a
> # metadata.connect('sqlite://name.db') here?
No. Even with a threadlocal metadata (which is *not* your case if you
are using version 0.3.0 or later), you only need to connect once per
thread, and you already connect just below.
> Movie(name='foo',year=2008,genre=Genre(name='bar'))
>
> def main():
> metadata.connect('sqlite://name.db')
> metadata.create_all()
> process_and_populate()
>
> if __name__ == '__main__':
> main()
--
Gaƫtan de Menten
http://openhex.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
-~----------~----~----~----~------~----~------~--~---