[ZODB-Dev] import problem?

Thomas Guettler hv at tbz-pariv.de
Thu Apr 1 07:31:18 EST 2004


Am Dienstag, 30. März 2004 18:56 schrieb db at zetamonks.com:
> Hi,
>
> I am a newbie with python and ZODB.  I have a problem with
> importing a module, I can't understand why the following code
> is not working.  (code is very ugly ;)
>
> Using ZODB 3.2.1c + Python 2.3.2 on a redhat 9.0 and freebsd 4.9
>
> See interactive session capture below the following code snippet
> for problem details.

Hi,

you already posted the answer:

> >>> import user
> >>> u=user.get_user('db')
--> failed

> >>> from user import *
> >>> u=get_user('db')
---> OK

ZODB stores the name of the class. The code
where you stored the user for the first
time, used "User()".  If you change the
namespace (first example) to user.User()
ZODB can't find the class. That's a bit
different from non-persistent python.

 HTH,
   Thomas





More information about the ZODB-Dev mailing list