On Thu, Dec 2, 2010 at 7:15 PM, Derek Ditch <derek.ditch...@gmail.com> wrote: > So, I've been able to begin building a graph reflecting relationships among > actors, but I've reached the point where it's huge iterations, so I'm > parallelizing it (using pp). The issue I'm having is that since I'm running > queries manually, I have to use sqlobject objects directly (i.e. CastInfo, > MovieInfoIdx, etc). I can do this in IPython by using "from imdb.parser.sql > import *", and then running my script (even though my script imports the > same). > When I run the script standalone, I get errors telling me that CastInfo > isn't defined. I see that these are exported into globals in the SQL imdb > access class __init__, so, how can I ensure I'm importing these correctly?
That instances/classes are not created until you run the getDBTables function of the proper module (objectadapter or alchemyadapter). The easiest way to do it: import imdb ia = imdb.IMDb('sql', 'sqlite:///tmp/imdb.db') print imdb.parser.sql.CastInfo As you can see, after the imdb.IMDb object is instanced, you can access the CastInfo (and other) class in the imdb.parser.sql module. It goes without saying that you've to replace 'sqlite:///tmp/imdb.db' with the correct credentials to access your database. :-) HTH, -- Davide Alberani <davide.alber...@gmail.com> [PGP KeyID: 0x465BFD47] http://www.mimante.net/ ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Imdbpy-devel mailing list Imdbpy-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-devel