Hi folks,

I have hacked on the export code to allow you to export more than one
object at a time.  Now I'm trying to grok the import code.  Can someone
help me figure out what's going on?

I have an export file in XML format that looks like this:

<?xml version="1.0"?>
  <record id="5602" aka="AAAAAAAAFeI=">
    [ first record's data here... ]
  <record id="5603" aka="AAAAAAAAFeM=">
     [ second record's data here... ]

If you export a folderish object, you'll see basically the same export
format.  (When you export a folder, you get all of the objects rooted in
that folder.)  The difference is that these two records are not related
-- they are simply both contained in the same folder.

The problem that happens on import is a KeyError on line 194 of this bit
of code:

lines 192-197 of lib/python/ZODB/ExportImport.py

                if oids:
                    if type(oid) is TupleType: oid=oid[0]

If I change this code to

                if oids and oids.has_key(ooid):
                    if type(oid) is TupleType: oid=oid[0]
then the import appears to succeed, but only the final object in the
file is actually imported.

I have to say that some comments would be nice in

Also, are both of these files used?


Plus, I am having a hard time finding the right documentation for
working directly with the ZODB to see what's going on.

Can someone help point me in the right direction?

Here's what I'm trying to accomplish:

1.  Allow multiple objects to be exported at once (this is working)
2.  Allow multiple objects to be imported at once (this is not)
3.  Allow imports to overwrite existing objects (haven't tried this yet)

Thanks in advance for any assistance.

Fred Wilson Horch                       mailto:[EMAIL PROTECTED]
Executive Director, EcoAccess           http://ecoaccess.org/
P.O. Box 2823, Durham, NC 27715-2823    phone: 919.419-8567

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to