WebDAV, Object types: Fie!
(First off, thanks for the tips on the breadcrumb stuff... I got it working) I've got some content I want to migrate into a new zope, and WebDAV currently looks like my best option (I'm on MacOS X, uploading to a zope living on a sun box). I've got the WebDAV working fine. When I drop *.html files into the dav windows, the files upload as DTML Document object types. The problem is, I want them uploading as Files, not DTML Documents, darn it... or at least, I seem to want to. See, when I put this in a python script: print context['content.html'] ... if it's a DTML document, I get the source of the DTML document, HTML escaped. By contrast, if it's a File (text/html), it just passes the HTML on through. So I guess there are two solutions, but I'll settle for one of them 1) How do I change the object type of an object? (I doubt this is possible, so a corollary would be, how do I get WebDAV to stop treating my .html files as DTML Documents) 2) How do I get a python script to recognize that if the content.html object is a DTML Document, it should not escape the HTML? -- Fred Hicks <iago@iago.net>
Didn't get a response on this, but did figure out an operative fix, which I'll post about in the interests of making it useful for anyone searching the mailing list archives: try: try: mytext = context['content.html']() except AttributeError: mytext = context['content.html'] print mytext except KeyError: print "<p>No content here yet!</p>" On Sat, 23 Mar 2002, Iago wrote:
See, when I put this in a python script:
print context['content.html']
... if it's a DTML document, I get the source of the DTML document, HTML escaped. By contrast, if it's a File (text/html), it just passes the HTML on through.
So I guess there are two solutions, but I'll settle for one of them
1) How do I change the object type of an object? (I doubt this is possible, so a corollary would be, how do I get WebDAV to stop treating my .html files as DTML Documents)
2) How do I get a python script to recognize that if the content.html object is a DTML Document, it should not escape the HTML?
-- Fred Hicks <iago@iago.net>
Iago writes:
(First off, thanks for the tips on the breadcrumb stuff... I got it working)
I've got some content I want to migrate into a new zope, and WebDAV currently looks like my best option (I'm on MacOS X, uploading to a zope living on a sun box). I've got the WebDAV working fine.
When I drop *.html files into the dav windows, the files upload as DTML Document object types. Search zope.org (via Google) for "PUT_factory"...
Dieter
participants (2)
-
Dieter Maurer -
Iago