[Zope] change textfile
Thu, 25 Jul 2002 11:58:10 +0200 (CEST)
I found out that this method(Image.manage_edit) has changed lately, and my
Zope is not up to date.
(Why is there only one person who can upgrade, and he is on vacation?
Typically isn't it?)
Thanks for all help!
On Wed, 24 Jul 2002, Bjørge Solli wrote:
> getattr(context,id).manage_edit(title, 'text/html', filedata=data)
> I tried it, and got this error:
> Error Value: manage_edit() got an unexpected keyword argument 'filedata'
> I looked at DTMLMethod.py:
> def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='50',
> Replaces a Documents contents with Data, Title with Title.
> And I looked at Image.py(which I think is the one I use):
> def manage_edit(self, title, content_type, precondition='',
> But that is wrong?
> Am I using the wrong method?
> > I suggest you install DocFinderEverywhere
> > <http://www.zope.org/Members/shh/DocFinderEverywhere>
> Well, I'm not root, but I'll ask for it when he comes back from his
> vacation on monday...
> On Wed, 24 Jul 2002, Stefan H. Holek wrote:
> > You will then be easily able to find out that File's manage_edit takes the
> > following parameters:
> > self, title, content_type, precondition='', filedata=None, REQUEST=None
> > Your call should thus look something like (untested):
> > yourfile.manage_edit('yourtitle', 'text/html', filedata='yourdata')
> > HTH,
> > Stefan
> > --On Mittwoch, 24. Juli 2002 12:58 +0200 Bjørge Solli <firstname.lastname@example.org>
> > wrote:
> > > I am trying to make and change a textfile.
> > >
> > > I'm trying to do it this way:
> > > context.manage_addFile(id)
> > > getattr(context,id).manage_edit(title,data)
> > >
> > > This sets content_type(Property) to the value of data. I want to put the
> > > contents of data INTO the file, and have content_type to be text/html.
> > >
> > > Any suggestions?
> > >
> > > Thanks in advance.
> > > regards
> > > Bjorge
> > > --
> > --
> > Those who write software only for pay should go hurt some other field.
> > /Erik Naggum/
Bjørge Solli - Universitas Bergensis, Norway
mailto:Bjorge@Kvarteret.no icq#29210281 MSN:email@example.com
Møllendalsv.19, 5009 Bergen, Norway tel:55202853/91614343