[Zope] Adding users via external database

Dieter Maurer dieter@handshake.de
Thu, 30 Aug 2001 22:36:45 +0200 (CEST)


Montagne, Michael writes:
 >  This is my code for adding a ZClass to the ZUser folder product.  I'm
 > trying to walk through a recordset returned by CurrEmployees and add each
 > one to the database.  I can successfully add a user if I take all the
 > database references out and plug in values manually, but when the <dtml-in
 > CurrEmployees> tag is involved I get an attribute error.  I'm afraid I've
 > committed some sort of namespace goofup but I'm stuck.  I know user_add
 > works because I can plug in numbers, and I know I'm getting values because I
 > print it out at the bottom. 
 > What could it be.....?
When you report such problems, you should say, which attribute
is not found....

Moreover, you got a traceback that tells you where the problem
was discovered. It helps a lot to localize the problem....

 >   <dtml-with database>
 >   <dtml-in CurrEmployees>
 >   <dtml-call "REQUEST.set('changed','no')">
 >   <dtml-call "REQUEST.set('added','no')">
 >   <dtml-comment><dtml-call
 > "REQUEST.set('users_in_folder',acl_users.getUsers())"></dtml-comment>
 >   <dtml-call "REQUEST.set('name',Login)">
 >   <dtml-call "REQUEST.set('password',password)">
 >   <dtml-call "REQUEST.set('confirm',password)">
 >   <dtml-call "REQUEST.set('staffid',StaffId)">
I had a similar problem which I chased for hours.

   It turned out that Oracle had converted my nice mixed-case
   column names into all upper-case.
   Of course, my trial to use the mixed-case name to access
   the columns resulted in a 'NameError'.

Maybe, your problem is similar. However, you reported
an AttributeError. Thus, probably not.

Thus, tell us: what attribute!


Dieter