[Zope] Newbie: creating objects programmatically
Wed, 14 May 2003 14:58:25 +0200
It works! The problem was the permissions - I tried changing the more
obvious ones but not 'View management screens'. I'm not sure how I
could have deduced that one.
For your info, I'm using Zope 2.6.1 SuSE Linux 8.2 accessing with Mozilla,
Konqueror and IE5. The latter 2 work just fine. I have a small issue with
Mozilla in that the 'Taller' and 'Shorter' buttons cause an 'invalid literal for
int(): 100%' error. I don't care about this because I use Quanta+ for page editing.
Thanks alot for your help
> > >1) method document_src() requires no parameters (self is passed
> > >implicitly
> > by python)
> > >so you write
> > >context.['index_html'].write(context.memberIndex.document_src())
> > I tried this and got the error message mentioned, so I tried
> > again with the
> > explicit 'self' - no go.
> > >2) To create a page template with a content, you may pass it in
> > >constructor:
> > >container.manage_addProduct['PageTemplates'],manage_addPageTe
> > mplaate('index_html',
> > text=context.memberIndex.document_src())
> > This is certainly more elegant and I had spotted it in
> > ZopePageTemplates.py
> > but I wanted to go step by step.
> > However, neither of the solutions works for me because I
> > always get the
> > 'Unauthorized' error message. With my limited experience, I
> > don't know how
> > to start debugging this. Can you help me again?
> I tried the solution on my WinXP+Zope 2.6.1 server and it works fine.
> What environment do you use? OS? Zope server version? Browser?
> How do you test it?
> Do you select "Test" tab in the ZMI or you open a new window and type
> URL ?
> There is a difference in browser behavior e.g. for Mozilla, no matter
> how many browser windows you open,
> you're still logged as the same zope user (Manager in your case)
> This doesn't always applies to IE.
> document_src() method requires 'View management screens' permission and
> if you open a new instance of IE,
> You're effectively an 'Anonymous User' which doesn't have it.
> If it is not the case, you may to use VerboseSecurity product
> to determine what persmission is missing
> Zope maillist - Zope@zope.org
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-dev )