[Zope-CMF] Publishing CMF Objects with ZPublisher.Client

Doyon, Jean-Francois Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Fri, 11 Jan 2002 17:11:55 -0500


Hello,

I'm trying to modify the load_site.py script in order to batch upload =
CMF
content using CMFDefault object-types, and am having some trouble.

Right now I have a line that says:

call(object.manage_addProduct['CMFDefault'].manage_addContent(type=3D'Do=
cument
', id=3Dname))

And it dies with the following:

Traceback (most recent call last):
  File "load_site.py", line 153, in ?
    if __name__=3D=3D'__main__': main()
  File "load_site.py", line 64, in main
    for f in files: upload_file(object, f)
  File "load_site.py", line 87, in upload_file
    return globals()['upload_'+ext](object, f)
  File "load_site.py", line 119, in upload_html
=20
call(object.manage_addProduct['CMFDefault'].manage_addContent(type=3D'Do=
cument
', id=3Dname))
AttributeError: Function instance has no attribute '__getitem__'


I tried tracking down why this occurs, but I have to admit I think this =
is a
bit over my head, I get lost at the Function part in Client.py :)  I =
have
load_site working great with non-CMF content however.

I also tried:

call(object.manage_addProduct['CMFDefault'].manage_addContent,type=3D'Do=
cument
', id=3Dname)

and

object.manage_addProduct['CMFDefault'].manage_addContent(type=3D'Documen=
t',
id=3Dname)

With no luck ...

Has anybody tried this before? It's pretty crucial to me that I be able =
to
do this! What am I missing?

Thank you,

Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410