Re: [Zope] namespace problems
Gary Lowder wrote: > > When I use "context.REQUEST.RESPONSE.redirect(URL1)" in my python script > I get "NameError URL1". That should be: RESPONSE = context.REQUEST.RESPONSE URL1 = context.REQUEST['URL1'] RESPONSE.redirect(URL1) > When I bind _ as you suggested, and use "_.RESPONSE.redirect(URL1)" I > get "AttributeError RESPONSE". Try _['RESPONSE'].redirect(_['URL1']) errr... maybe DTML wasn't so bad afterall ;-) *sigh* Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
I really appreciate your help, but I continue to have problems with this line, and this is turning into a quest of sorts ;) . When I use "context.REQUEST.RESPONSE.redirect(URL1)" in my python script I get "NameError URL1". When I bind _ as you suggested, and use "_.RESPONSE.redirect(URL1)" I get "AttributeError RESPONSE". I'm confused, but very grateful for your help so far. Gary. Chris Withers wrote: > > > Chris Withers wrote: > > > > > > > How would I do the URL redirect using an equivalent to the > > > >that's in the DTML Method below? > > > > > > context.RESPONSE.redirect(URL1) > > D'Oh... > > Either replace it with: > > context.REQUEST.RESPONSE.redirect(URL1) > > ...or do the following: > > -Go to the bindings tab and bind _ to the Namespace. > -Then do _.RESPONSE.redirect(URL1) > > cheers, > > Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
> Chris Withers wrote: > > > > > How would I do the URL redirect using an equivalent to the > > >that's in the DTML Method below? > > > > context.RESPONSE.redirect(URL1) D'Oh... Either replace it with: context.REQUEST.RESPONSE.redirect(URL1) ...or do the following: -Go to the bindings tab and bind _ to the Namespace. -Then do _.RESPONSE.redirect(URL1) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
with your line dropped in, my python script still gives me: Error Type: AttributeError Error Value: RESPONSE I'm passing variables via a , how do I let python access that namespace? Thanks, Gary. Chris Withers wrote: > > > How would I do the URL redirect using an equivalent to the > >that's in the DTML Method below? > > context.RESPONSE.redirect(URL1) > > cheers, > > Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
> How would I do the URL redirect using an equivalent to the >that's in the DTML Method below? context.RESPONSE.redirect(URL1) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
As an aside: I can get the mess below to work with a python script, BUT, I don't know how to do the URL redirect with python as it's listed in the DTML Method. (python script snippet) context.manage_addFolder(name, name) doc=getattr(context, name) doc.manage_addProperty('number', number, 'int') doc.manage_addProperty('exp_date', exp_date, 'date') How would I do the URL redirect using an equivalent to the that's in the DTML Method below? Many thanks again for your time and effort. Gary. Gary Lowder wrote: > > I'm currently trying to add a new folder to an old folder, using input > from a calling form, then add two properties to that new folder. I > searched the mailing list, and came up with an example that led me to > the following, but I'm still getting "Error Type: NameError" "Error > Value: manage_addProperty". > > Where is my mistake? > > The following line works as expected. > > > > Something below here isn't right. > > >type='int')"> >type='date')"> > > > > > Thanks for you help! > Gary. > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] namespace problems
I'm currently trying to add a new folder to an old folder, using input from a calling form, then add two properties to that new folder. I searched the mailing list, and came up with an example that led me to the following, but I'm still getting "Error Type: NameError" "Error Value: manage_addProperty". Where is my mistake? The following line works as expected. Something below here isn't right. Thanks for you help! Gary. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: How to use standard html headers and footers properly (was: Re:[Zope] Namespace problems...)[Zope] Namespace problems...)
Hi, first, thanks for your advice! "Manuel Amador (Rudd-O)" schrieb: > > > > > > on your document, WILL work fine. > > But I suggest recreating standard_html_header as a METHOD and calling OK, once again: My standard_html_header is still a METHOD!!! And within it, I DO access to the variables of the calling document / method! > > > > That's _exactly_ what I did! I only inserted a to pass this var to standard_html_header. > > Since methods don't have properties, they will use calling object's > properties. Read again. Do NOT use DTML documents for headers and > footers. Use METHODS. I DON'T! >> So I stored my headers and footers and many other things in >> root/intra/pub. >> >> All the other documents are stored in root/intra and below. >> >> I've got my standard_html_header, with which I can display >> user-defined >> titles which may also contain values of global properties. The >> user-defined title is being built in the document before the header >> is >> called, e. g. something like: > Look above! >> In the standard_html_header !!!>>>_method_<<> whether there is a titel attribute or not. > >> This works fine. > >> But for general use I want to keep the possibility of displaying the >> >> title_or_id of the document when I don't introduce a user-defined >> title. >> >> This would be no problem if s_h_h wasn't situated in root/intra/pub, >> so I have >> to call it within the . >> >> But calling it within the , pub is on the top of my >> namespace, so that calling title_or_id returns the title_or_id of >> the container of s_h_h, i. e. >> pub, INSERTED: and not as wanted the title_or_id of the calling >> document! > >> How can I nevertheless access within the s_h_h to the title_or_id of >> my >> original document? INSERTED: i. e. explicitely accessing to a >> layer of the namespace which isn't on its top! > Hope I now explained it well enough. Thank you very much. Lars ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How to use standard html headers and footers properly (was: Re: [Zope]Namespace problems...)Namespace problems...)
on your document, WILL work fine. But I suggest recreating standard_html_header as a METHOD and calling Since methods don't have properties, they will use calling object's properties. Read again. Do NOT use DTML documents for headers and footers. Use METHODS. Lars Heber wrote: Hi there, I've still got to build a bigger website. So I stored my headers and footers and many other things in root/pub. All the other documents are stored in root/Intra and below. I've got my standard_html_header, with which I can display user-defined titles which may also contain values of global properties. The user-defined title is being built in the document before the header is called, e. g. something like: In the standard_html_header method I'm checking whether there is a titel attribute or not. This works fine. But for general use I want to keep the possibility of displaying the title_or_id of the document when I don't introduce a user-defined title. This would be no problem if s_h_h wasn't situated in root/pub, so I have to call it within the . But doing this, pub is on the top of my namespace, so that calling title_or_id returns the title_or_id of the container of s_h_h, i. e. pub! How can I nevertheless access within the s_h_h to the title_or_id of my original document? Thanks. Lars ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -- Manuel Amador (Rudd-O)
[Zope] Namespace problems...
Hi there, I've still got to build a bigger website. So I stored my headers and footers and many other things in root/pub. All the other documents are stored in root/Intra and below. I've got my standard_html_header, with which I can display user-defined titles which may also contain values of global properties. The user-defined title is being built in the document before the header is called, e. g. something like: In the standard_html_header method I'm checking whether there is a titel attribute or not. This works fine. But for general use I want to keep the possibility of displaying the title_or_id of the document when I don't introduce a user-defined title. This would be no problem if s_h_h wasn't situated in root/pub, so I have to call it within the . But doing this, pub is on the top of my namespace, so that calling title_or_id returns the title_or_id of the container of s_h_h, i. e. pub! How can I nevertheless access within the s_h_h to the title_or_id of my original document? Thanks. Lars ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )