MetaKit issues with Python 2.2.1 CGI script

Wayne Pierce wayne at mishre.com
Wed Oct 2 23:03:18 EDT 2002


I have been working on a CGI script that is supposed store data into a
MetaKit database, but is only storing one character per 'field.'

I can create the database manually at the interactive shell and it
works fine, so I know that part is working properly.  When I set the
CGI script to print the line that would be passed to <view>.append()
it looks fine.

Hoever, when I actually pass the line to .append() it takes the first
character from the string and puts it into the first field.  The
second character goes into the next field, etc.  For example:

    import metakit
    db = metakit.storage("officer.mk",1)
    ovw = db.view("officer")

    data = "reportingAgency='%s',firstName='%s',lastName='%s',email='%s',number='%s'"
% (reportingAgency,firstName,lastName,email,number)

  /*
    The above data is parsed from a CGI form.
  */

    ovw.append(data)
    db.commit()

When I run the above code, it stores the data like this:

Name                Value
reportingAgency       r
firstName             e
lastName              p
email                 o
number                r

It takes the first item passed to the .append() and places one char in
each field.  If I change the order the char passed into each field
changes accordingly.  I have verified that the data being passed into
the .append() is a str and there is no excess white space (not that it
would matter).

Has anyone seen this before?  I am at a loss on what to try next.

Thanks for any suggestions,

Wayne



More information about the Python-list mailing list