From jim at microbrightfield.com Thu Apr 1 14:25:49 2004 From: jim at microbrightfield.com (James Carroll) Date: Thu Apr 1 14:25:51 2004 Subject: [ZPT] checking equality on a defined variable? Help? Message-ID: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037625@exchange.microbrightfield.com> I'm looking for the word 'True' here, but instead I get 'False': Which RMAs?: is active? This produces the following: Which RMAs?: 'active' is active? False Can anyone spot the problem? Thanks! -Jim From andreas at andreas-jung.com Thu Apr 1 14:56:52 2004 From: andreas at andreas-jung.com (Andreas Jung) Date: Thu Apr 1 14:56:59 2004 Subject: [ZPT] checking equality on a defined variable? Help? In-Reply-To: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037625@exchange.microbrightfield.com> References: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037625@exchange.microbrightfiel d.com> Message-ID: <2147483647.1080856612@[192.168.0.105]> --On Donnerstag, 1. April 2004 14:25 Uhr -0500 James Carroll wrote: > > I'm looking for the word 'True' here, but instead I get 'False': > > ^^^^^^^^^^^ This creates a single-quoted string and not an unquoted string. -aj From jim at microbrightfield.com Fri Apr 2 09:03:19 2004 From: jim at microbrightfield.com (James Carroll) Date: Fri Apr 2 09:03:22 2004 Subject: [ZPT] Newbie: Editing / creating database records with single zpt form + scripts? Message-ID: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037629@exchange.microbrightfield.com> Hi, I'm trying to put together a simple database list / edit / add for RMAs. So far, I have it mostly working for editing. From my rma list page, I have links to edit_rma?rma_id=1 and the zsql looks for the rma_id. In my edit form: I am doing: (which only repeats once, and works mostly) Whenever I try the following: I get a 'tuples indicies must be integers' error
So what I'd like to do instead is have a begin_edit_rma script like: request = container.REQUEST RESPONSE = request.RESPONSE if request.has_key('rma_id'): res = container.retrieve_rma(rma_id=request['rma_id']) return container.edit_rma(rma=res.dictionaries()[0]) # otherwise we're starting blank rma={} rma['mbf_id']="newrmaid" return container.edit_rma(rma) and then just key off the rma dictionary But nothing is working 'cause I don't exactly know what I'm doing. Does anyone have a good example of editing and creating database records? Thanks! -Jim From Claire.Sherrington at nzx.com Fri Apr 2 12:00:38 2004 From: Claire.Sherrington at nzx.com (Claire Sherrington) Date: Fri Apr 2 12:01:09 2004 Subject: [ZPT] Re: ZPT Digest, Vol 13, Issue 1 (On leave : 2nd April to 13th April) Message-ID: Claire Sherrington is on leave until 13th April , if your query is web site related please contact Alice Talbot (alice.talbot@nzx.com , 496 2878) for content issues or Richard Merryweather (richard.merryweather@nzx.com , 495 2815) for techincal issues Many thanks, Claire From dieter at handshake.de Fri Apr 2 18:26:02 2004 From: dieter at handshake.de (Dieter Maurer) Date: Fri Apr 2 19:12:07 2004 Subject: [ZPT] Newbie: Editing / creating database records with single zpt form + scripts? In-Reply-To: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037629@exchange.microbrightfield.com> References: <5EA4B2EDD4BA8B4C84BE11298F81ADC4037629@exchange.microbrightfield.com> Message-ID: <16493.63114.71682.540319@gargle.gargle.HOWL> James Carroll wrote at 2004-4-2 09:03 -0500: > ... >I am doing: (which only repeats once, and works mostly) > > >Whenever I try the following: > >I get a 'tuples indicies must be integers' error It is unlikely that this error come from here. Whenever you get errors, it is essential to look at the traceback. It tells you where precisely the error was detected. This is invaluable information. You find the traceback in the "error_log" object of your Zope "Root Folder". -- Dieter From jprakash13 at netscape.net Sun Apr 4 19:08:22 2004 From: jprakash13 at netscape.net (jprakash13@netscape.net) Date: Sun Apr 4 19:08:32 2004 Subject: [ZPT] HELP XML , ZPT ESCAPE SEQUENCE FOR '<' Message-ID: <77F651A5.291E6B2B.0F97EF24@netscape.net> whenever i test this page text/xml zpt page an RSS feed ---- Date Comes here Head Comes here --- removeHtml python script takes " , but even before this script is called , when i test the above page it throws this error Only one top level element is allowed in an XML document. Error processing resource 'http://stage.ebizq.net/newsite/prakashtest/rssfeed'. Line 3, Position 6

-----^ is this a bug or is there any escape sequence so that it can passed to the python script. "Help urgent" Thanks prakash __________________________________________________________________ Introducing the New Netscape Internet Service. Only $9.95 a month -- Sign up today at http://isp.netscape.com/register Netscape. Just the Net You Need. New! Netscape Toolbar for Internet Explorer Search from anywhere on the Web and block those annoying pop-ups. Download now at http://channels.netscape.com/ns/search/install.jsp From random at dxtx.net Sun Apr 4 20:40:46 2004 From: random at dxtx.net (random@dxtx.net) Date: Sun Apr 4 20:41:02 2004 Subject: [ZPT] repeat and odd/even question Message-ID: <002d01c41aa6$a43b4ea0$0200a8c0@NOISE> Hi ZPT list, I have a brief question.. I have a tal:repeat running from a db query, and i want to stagger the results in two columns, so it will look like this: data1 .. data2 data3 .. data4 data5 .. data6 data7 I am using the odd/even checking and I ALMOST have this working. My problem is that since the repeat is on a , and i have to do a lot of html

formatting for each column, i can't properly close each row. Here's a psuedocode version of my setup. if even, do if odd, do You can see the problem is that I only want to close the tablerow after it does the right column. But I can't put the there inside the odd column's condition, because it breaks because of what i assume are nesting problems. (a inside the right column tags, where the opening is way above it and outside the tags) for some reason i can't think of a logical solution to this using ZPT...... :( any help/tips would be MUCH appreciated, thank you tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040404/6d3893ca/attachment.html From lists at elvix.com Mon Apr 5 05:10:34 2004 From: lists at elvix.com (=?ISO-8859-15?B?R2VpciBC5mtob2x0?=) Date: Mon Apr 5 05:12:15 2004 Subject: [ZPT] repeat and odd/even question In-Reply-To: <002d01c41aa6$a43b4ea0$0200a8c0@NOISE> References: <002d01c41aa6$a43b4ea0$0200a8c0@NOISE> Message-ID: <1694401698.20040405111034@elvix.com> random, Monday, April 5, 2004, 2:40:46 AM, you wrote: > I have a brief question.. I have a tal:repeat running from a db > query, and i want to stagger the results in two columns, so > it will look like this: > data1 .. data2 > data3 .. data4 > data5 .. data6 > data7 the cleanest way would be to write a pythonscript that splits your result sequence into a list of lists [[data1,data2],[data3,data4],[data5,data6]] then you can simply loop the outer list for rows and each inner for the cells. suddenly , all is a lot cleaner and the need for logic in your template is a lot smaller :) -- __________________________________________________________________ Geir B?kholt ? Interaction Engineer ? Plone Solutions Development ? Training ? Support ? http://www.plonesolutions.com __________________________________________________________________ From lists at simplistix.co.uk Mon Apr 5 06:55:20 2004 From: lists at simplistix.co.uk (Chris Withers) Date: Mon Apr 5 06:55:25 2004 Subject: [ZPT] HELP XML , ZPT ESCAPE SEQUENCE FOR '<' In-Reply-To: <77F651A5.291E6B2B.0F97EF24@netscape.net> References: <77F651A5.291E6B2B.0F97EF24@netscape.net> Message-ID: <40713B18.2070707@simplistix.co.uk> jprakash13@netscape.net wrote: > whenever i test this page text/xml zpt page an RSS feed > ---- > > Date Comes here > Head Comes here > > --- > > removeHtml python script takes " , but even before this script is called , when i test the above page it throws this error Removing HTML is a lot more complex than that ;-) try stripogram's html2safehtml function. > Only one top level element is allowed in an XML document. Error processing resource 'http://stage.ebizq.net/newsite/prakashtest/rssfeed'. Line 3, Position 6 this is a pretty explicit error message. The snippet abvoe doesn't have a single root element as required for XML, as stated in the error message... try: Date Comes here Head Comes here cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From sfooeotagvbph at msn.com Thu Apr 8 14:03:55 2004 From: sfooeotagvbph at msn.com (Tyson Burch) Date: Thu Apr 8 13:08:47 2004 Subject: [ZPT] I need your help... Message-ID: <200404081708.i38H8S58060657@mxzilla3.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040408/280479f3/attachment.html From daniel at velir.com Tue Apr 13 16:55:59 2004 From: daniel at velir.com (Daniel DeLay) Date: Tue Apr 13 16:56:07 2004 Subject: [ZPT] External Methods and special characters Message-ID: Hi, I have an external method that issues an xml-rpc request. When the return value for this request contains an accent mark I get this error message: ExpatError: not well-formed (invalid token) Is there some special handling I need to do when receiving special characters like this? Thanks! - Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040413/74b8618b/attachment.html From fred at zope.com Tue Apr 13 17:22:17 2004 From: fred at zope.com (Fred Drake) Date: Tue Apr 13 17:22:31 2004 Subject: [ZPT] External Methods and special characters In-Reply-To: References: Message-ID: <200404131722.17290.fred@zope.com> On Tuesday 13 April 2004 04:55 pm, Daniel DeLay wrote: > I have an external method that issues an xml-rpc request. > When the return value for this request contains an accent mark I get this > error message: ExpatError: not well-formed (invalid token) It's not unusual for someone to toss Latin-1 into a message accidentally and not add an XML declaration to specify the encoding. Have you checked the input message carefully? Also, what version of Expat are you using? You should be using 1.95.7 if possible, though I don't recall in bugs in the decoding for a long time. You can get the version from Python: >>> from xml.parsers import expat >>> expat.version_info (1, 95, 7) -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fernando at cmartins.demon.nl Wed Apr 14 18:39:31 2004 From: fernando at cmartins.demon.nl (Fernando Martins) Date: Wed Apr 14 18:40:22 2004 Subject: [ZPT] Accessing ZPT options name in Python Script Message-ID: Hi, Is there a way in a Python Script called from a Page Template to access the options name(space) of the page template itself? Of course this could be passed to the script by using its parameters but I was thinking more on a binding-based solution (which I couldn't figure out). Fernando From casey at zope.com Thu Apr 15 15:02:55 2004 From: casey at zope.com (Casey Duncan) Date: Thu Apr 15 15:01:32 2004 Subject: [ZPT] Re: Accessing ZPT options name in Python Script References: Message-ID: <20040415150255.492091c7.casey@zope.com> On Thu, 15 Apr 2004 00:39:31 +0200 "Fernando Martins" wrote: > Hi, > > Is there a way in a Python Script called from a Page Template to > access the options name(space) of the page template itself? > > Of course this could be passed to the script by using its parameters > but I was thinking more on a binding-based solution (which I couldn't > figure out). There is no implicit binding between namespaces here like there was in DTML, and that's a good thing! 'options' is just a dictionary (or dict-alike thing) so it should be easy to map it to kwargs in the python script or you can just pass it as a single argument. Imagine a script:: ## Script (Python) "get_stuff" ##parameters=stuff return 'you passed me %s' % stuff.keys() And in a template somewhere::
Stuff goes here
hth, -Casey From fernando at cmartins.demon.nl Thu Apr 15 17:03:38 2004 From: fernando at cmartins.demon.nl (Fernando Martins) Date: Thu Apr 15 17:04:37 2004 Subject: [ZPT] Re: Accessing ZPT options name in Python Script In-Reply-To: <20040415150255.492091c7.casey@zope.com> Message-ID: Casey Duncan wrote: > "Fernando Martins" wrote: > > Is there a way in a Python Script called from a Page Template to > > access the options name(space) of the page template itself? > > > > Of course this could be passed to the script by using its parameters > > but I was thinking more on a binding-based solution (which I couldn't > > figure out). > > There is no implicit binding between namespaces here like there was in > DTML, and that's a good thing! 'options' is just a dictionary (or I'm really not familiar with DTML (and happy about that from what I've seen). Does the problem come from the "implicitness"? Why not have an explicit binding for the calling template, or treating the Script as a method of the object "template"? In fact, I was surprised to see that "context" seems to be the folder of the template and not the template itself. > dict-alike thing) so it should be easy to map it to kwargs in the python > script or you can just pass it as a single argument. Imagine a script:: > > ## Script (Python) "get_stuff" > ##parameters=stuff > return 'you passed me %s' % stuff.keys() > > And in a template somewhere:: > >
> Stuff goes here
> Well, that's what I'm doing but the clarification was usefull anyways, thanks. Fernando From prudek at bvx.cz Fri Apr 16 04:18:05 2004 From: prudek at bvx.cz (Milos Prudek) Date: Fri Apr 16 04:18:16 2004 Subject: [ZPT] PlacelessTranslationService Message-ID: <407F96BD.1020107@bvx.cz> What's the correct ZPT syntax for PlacelessTranslationService? I tried this: Good morning This gets rendered into: Good morning No translation, although I do have an entry for 'Good morning' in my .po file under an 'ibc' domain. Is my syntax wrong? Is there something else that needs to be installed? I have: - vanilla Zope 2.7 - PlacelessTranslationService - no other products, no Plone, no CMF Background: The syntax I used is derived from documentation at http://dev.zope.org/Members/lalo/PlacelessTranslationService and http://dev.zope.org/Members/efge/TranslationService. And it does not work. -- Milos Prudek From tsnell at enervation.com Fri Apr 16 04:55:24 2004 From: tsnell at enervation.com (Tom Snell) Date: Fri Apr 16 04:55:38 2004 Subject: [ZPT] PlacelessTranslationService In-Reply-To: <407F96BD.1020107@bvx.cz> References: <407F96BD.1020107@bvx.cz> Message-ID: <407F9F7C.6030009@enervation.com> You are aware that PTS is not the same as TranslationService and that TranslationService is deprecated? Tom Snell Milos Prudek wrote: > What's the correct ZPT syntax for PlacelessTranslationService? > > I tried this: > > Good > morning > > This gets rendered into: Good morning > > No translation, although I do have an entry for 'Good morning' in my > .po file under an 'ibc' domain. > > Is my syntax wrong? > > Is there something else that needs to be installed? I have: > - vanilla Zope 2.7 > - PlacelessTranslationService > - no other products, no Plone, no CMF > > Background: The syntax I used is derived from documentation at > http://dev.zope.org/Members/lalo/PlacelessTranslationService and > http://dev.zope.org/Members/efge/TranslationService. And it does not > work. > From prudek at bvx.cz Fri Apr 16 07:50:14 2004 From: prudek at bvx.cz (Milos Prudek) Date: Fri Apr 16 07:50:23 2004 Subject: [ZPT] PlacelessTranslationService In-Reply-To: <407F9F7C.6030009@enervation.com> References: <407F96BD.1020107@bvx.cz> <407F9F7C.6030009@enervation.com> Message-ID: <407FC876.7010303@bvx.cz> Tom Snell wrote: > You are aware that PTS is not the same as TranslationService and that > TranslationService is deprecated? Yes. I know that. Are you implying that the syntax I use is incorrect for PTS? I could not find any other resource for ZPT syntax for PTS. That's why I used the document at http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZPTInternationalizationSupport. Can you please tell me what is the correct ZPT syntax for PTS ? -- Milos Prudek From casey at zope.com Fri Apr 16 09:47:05 2004 From: casey at zope.com (Casey Duncan) Date: Fri Apr 16 09:45:37 2004 Subject: [ZPT] Re: Accessing ZPT options name in Python Script References: <20040415150255.492091c7.casey@zope.com> Message-ID: <20040416094705.47a14afd.casey@zope.com> On Thu, 15 Apr 2004 23:03:38 +0200 "Fernando Martins" wrote: > Casey Duncan wrote: > > "Fernando Martins" wrote: > > > Is there a way in a Python Script called from a Page Template to > > > access the options name(space) of the page template itself? > > > > > > Of course this could be passed to the script by using its > > > parameters but I was thinking more on a binding-based solution > > > (which I couldn't figure out). > > > > There is no implicit binding between namespaces here like there was > > in DTML, and that's a good thing! 'options' is just a dictionary (or > > I'm really not familiar with DTML (and happy about that from what I've > seen). Does the problem come from the "implicitness"? Why not have an > explicit binding for the calling template, or treating the Script as a > method of the object "template"? > > In fact, I was surprised to see that "context" seems to be the folder > of the template and not the template itself. You could call the script in the context of the template (use python:template.script()), but it would not help you. 'options' is not an attribute of the template, it is a transient value bound to the call frame of the template code being executed. It is a run-time variable, not a persistent data element. -Casey From evan at 4-am.com Fri Apr 16 12:47:50 2004 From: evan at 4-am.com (Evan Simpson) Date: Fri Apr 16 12:49:57 2004 Subject: [ZPT] Re: Accessing ZPT options name in Python Script In-Reply-To: References: Message-ID: <40800E36.4070901@4-am.com> Fernando Martins wrote: > Is there a way in a Python Script called from a Page Template to access the > options name(space) of the page template itself? Only if you call it using a path expression. Try the following pair:




## Script (Python) "print_bind"
##bind namespace=b
##parameters=
##
for name in 'options', 'here', 'container':
   try:
     print name, ':', b[name]
   except:
     print name, 'not found in b.'
return printed


Cheers,

Evan @ 4-am



From tsnell at enervation.com  Fri Apr 16 13:42:51 2004
From: tsnell at enervation.com (Tom Snell)
Date: Fri Apr 16 13:43:00 2004
Subject: [ZPT] PlacelessTranslationService
In-Reply-To: <407FC876.7010303@bvx.cz>
References: <407F96BD.1020107@bvx.cz> <407F9F7C.6030009@enervation.com>
	<407FC876.7010303@bvx.cz>
Message-ID: <40801B1B.6010305@enervation.com>

Milos Prudek wrote:

> SEE BELOW
>
> Tom Snell wrote:
>
>> You are aware that PTS is not the same as TranslationService and that 
>> TranslationService is deprecated?
>
>
> Yes. I know that.
>
> Are you implying that the syntax I use  is incorrect for 
> PTS?              NO I WAS MERELY TRYING TO CLARIFY THE ONE POINT 
> WHERE I KNEW I COULD MAKE A CONTRIBUTION
>
> I could not find any other resource for ZPT syntax for PTS. That's why 
> I used the document at 
> http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZPTInternationalizationSupport.       
> THAT IS THE ONLY DOCUMENT I KNOW OF AND I HAVE RESEARCHED AND WATCHED 
> THE SUBJECT FOR OVER FOUR MONTHS NOW
>
> Can you please tell me what is the correct ZPT syntax for PTS ?     I 
> BELIEVE IF YOU COMPARE THE SYNTAX IN SOME PO FILES WITH  
> ZPTInternationalizationSupport YOU WILL FIND THEY ARE IDENTICAL.


I DO NOT KNOW WHERE YOUR PROBLEM IS   .

tom

>
>


From prudek at bvx.cz  Sun Apr 18 03:55:20 2004
From: prudek at bvx.cz (Milos Prudek)
Date: Sun Apr 18 03:55:42 2004
Subject: [ZPT] PlacelessTranslationService
In-Reply-To: <40801B1B.6010305@enervation.com>
References: <407F96BD.1020107@bvx.cz> <407F9F7C.6030009@enervation.com>
	<407FC876.7010303@bvx.cz> <40801B1B.6010305@enervation.com>
Message-ID: <40823468.4070408@bvx.cz>

>> THAT IS THE ONLY DOCUMENT I KNOW OF AND I HAVE RESEARCHED AND WATCHED 
>> THE SUBJECT FOR OVER FOUR MONTHS NOW

Thank you.

-- 
Milos Prudek


From fernando at cmartins.demon.nl  Mon Apr 19 03:24:18 2004
From: fernando at cmartins.demon.nl (Fernando Martins)
Date: Mon Apr 19 03:25:40 2004
Subject: [ZPT] Re: Accessing ZPT options name in Python Script
In-Reply-To: <40800E36.4070901@4-am.com>
Message-ID: 

Evan Simpson wrote:
> Fernando Martins wrote:
> > Is there a way in a Python Script called from a Page Template
> to access the
> > options name(space) of the page template itself?
>
> Only if you call it using a path expression.  Try the following pair:

That's what I wanted.

>
> 
> 

> 

>
>
> ## Script (Python) "print_bind"
> ##bind namespace=b
> ##parameters=
> ##

Aha! My intuition was rigth. Together with the other remarks from Casey
Duncan, I get it. And from the zope book:

"Namespace
    The Namespace binding is left blank by default. If your script is called
from a DTML Method, and you have chosen a name for this binding, then the
named variable contains the DTML namespace explained in the chapter entitled
Advanced DTML ."

Mutatis mutantis for ZPT and I guess DTML strikes back with a revenge!

It's just a pitty the difference in semantics (in the path vs python syntax)
from what should be the same thing, no?

Care to explain what's going on?

Many thanks,

Fernando


From evan at 4-am.com  Mon Apr 19 15:14:24 2004
From: evan at 4-am.com (Evan Simpson)
Date: Mon Apr 19 15:16:40 2004
Subject: [ZPT] Re: Accessing ZPT options name in Python Script
In-Reply-To: 
References: <40800E36.4070901@4-am.com>
	
Message-ID: <40842510.50702@4-am.com>

Fernando Martins wrote:
> It's just a pitty the difference in semantics (in the path vs python syntax)
> from what should be the same thing, no?
> 
> Care to explain what's going on?

When you use , you are invoking a fair amount of DTML 
"magic" in order to find 'foo' and figure out how to call it.  If 'foo' 
turns out to be a DTML Method or Document, dtml-var knows to pass the 
REQUEST object and the namespace stack to it.  If you have ever been 
forced to use a python expression to call DTML from DTML, you know how 
painful the loss of this "magic" can be -- you end up having to write 
something like .

ZPT has a similar dichotomy.  Path evaluation includes a bit of "magic" 
(although not so much as DTML) to make life easier, and this includes 
recognizing when a called object wants namespace information.  There's a 
(probably undocumented) __render_with_namespace__ interface implemented 
by Shared/DC/Scripts/Bindings.py, that allows an object to be called 
DTML-style.  DTML objects don't use this, marking themselves with an 
'isDocTemp' attribute instead :-P

Python expressions, in both worlds, mean exactly what they say.  There's 
very little room for "magic", and certainly no place for trying to 
re-interpret function calls, so you end up having to pass everything 
explicitly.

Cheers,

Evan @ 4-am



From jonas.nielsen at eea.eu.int  Wed Apr 21 03:16:15 2004
From: jonas.nielsen at eea.eu.int (Jonas Nielsen)
Date: Wed Apr 21 03:20:59 2004
Subject: [ZPT] newline_to_br
Message-ID: 

I have the following line of code

This results in the following html a line<br> a new line<br> How do I get the following ?: a line
a new line
From santi at zetadb.com Wed Apr 21 05:29:18 2004 From: santi at zetadb.com (Santi Camps) Date: Wed Apr 21 03:27:41 2004 Subject: [ZPT] newline_to_br In-Reply-To: References: Message-ID: <40863EEE.4060204@zetadb.com> Jonas Nielsen escribi?: >I have the following line of code > >
>
>
>
>
>
> >This results in the following html > >a line<br> >a new line<br> > >How do I get the following ?: > >a line
>a new line
> > > Just add "structure" clause to each tal:content
Santi Camps http://www.earcon.com/adf From jonas.nielsen at eea.eu.int Wed Apr 21 03:34:11 2004 From: jonas.nielsen at eea.eu.int (Jonas Nielsen) Date: Wed Apr 21 03:34:19 2004 Subject: [ZPT] Re: newline_to_br References: <40863EEE.4060204@zetadb.com> Message-ID: Santi Camps wrote: > Just add "structure" clause to each tal:content Thank you From contact_tonico at yahoo.de Wed Apr 21 11:37:28 2004 From: contact_tonico at yahoo.de (Tonico Strasser) Date: Wed Apr 21 11:40:28 2004 Subject: [ZPT] Entities in Attributes Message-ID: Hello, when I try the following: I get two different results. I would expect the same value. How can I insert the value of the first input dynamically into an attribute? Tonico From dieter at handshake.de Thu Apr 22 18:26:18 2004 From: dieter at handshake.de (Dieter Maurer) Date: Thu Apr 22 19:40:02 2004 Subject: [ZPT] Entities in Attributes In-Reply-To: References: Message-ID: <16520.18058.326947.896982@gargle.gargle.HOWL> Tonico Strasser wrote at 2004-4-21 17:37 +0200: >when I try the following: > > > > >I get two different results. I would expect the same value. > >How can I insert the value of the first input dynamically into an attribute? What Zope version are you using? When I looked at the Zope 2.7 code, I had the impression that entity references were handled correctly *when* they were produced by "default". They were escaped, however, when they came from another expression. In a private copy, I implemented the "structure" keyword that prevents escaping in a similar way to "tal:content". -- Dieter From contact_tonico at yahoo.de Fri Apr 23 07:17:47 2004 From: contact_tonico at yahoo.de (Tonico Strasser) Date: Fri Apr 23 07:02:32 2004 Subject: [ZPT] Re: Entities in Attributes In-Reply-To: <16520.18058.326947.896982@gargle.gargle.HOWL> References: <16520.18058.326947.896982@gargle.gargle.HOWL> Message-ID: <4088FB5B.2030806@yahoo.de> Dieter Maurer wrote: > Tonico Strasser wrote at 2004-4-21 17:37 +0200: > >>when I try the following: >> >> >> >> >>I get two different results. I would expect the same value. >> >>How can I insert the value of the first input dynamically into an attribute? > > > What Zope version are you using? Zope 2.6.4-rc1 > When I looked at the Zope 2.7 code, I had the impression > that entity references were handled correctly *when* they > were produced by "default". > They were escaped, however, when they came from another expression. Right, this seems to be fixed ind 2.7. > In a private copy, I implemented the "structure" keyword that > prevents escaping in a similar way to "tal:content". Would like to see it in future TAL versions. Thanks. Tonico From contact_tonico at yahoo.de Fri Apr 23 07:17:47 2004 From: contact_tonico at yahoo.de (Tonico Strasser) Date: Fri Apr 23 07:02:33 2004 Subject: [ZPT] Re: Entities in Attributes In-Reply-To: <16520.18058.326947.896982@gargle.gargle.HOWL> References: <16520.18058.326947.896982@gargle.gargle.HOWL> Message-ID: <4088FB5B.2030806@yahoo.de> Dieter Maurer wrote: > Tonico Strasser wrote at 2004-4-21 17:37 +0200: > >>when I try the following: >> >> >> >> >>I get two different results. I would expect the same value. >> >>How can I insert the value of the first input dynamically into an attribute? > > > What Zope version are you using? Zope 2.6.4-rc1 > When I looked at the Zope 2.7 code, I had the impression > that entity references were handled correctly *when* they > were produced by "default". > They were escaped, however, when they came from another expression. Right, this seems to be fixed ind 2.7. > In a private copy, I implemented the "structure" keyword that > prevents escaping in a similar way to "tal:content". Would like to see it in future TAL versions. Thanks. Tonico From Joe.Nguyen at coair.com Fri Apr 23 16:12:47 2004 From: Joe.Nguyen at coair.com (Nguyen, Joe) Date: Fri Apr 23 16:14:32 2004 Subject: [ZPT] Adding users in Plone 2.0 Programmatically? Message-ID: <28A471EF3151244187A887958F39415D0D95AFE6@nhqjexc02.nam.coair.com> How would I go about adding a user (members) programmatically in plone 2 with their name, password, roles, and domains as fields? I used this script in plone 1.05. name = context.REQUEST.get('name') password = context.REQUEST.get('password') userfolder = getattr(container, 'acl_users') user_info = { 'name': name, 'password': password, 'confirm': password, 'roles': ['Member'], 'domains': [] } userfolder.manage_users(submit='Add', REQUEST=user_info) Any help would be much appreciated! Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040423/5e02072d/attachment.html From dieter at handshake.de Fri Apr 23 13:44:17 2004 From: dieter at handshake.de (Dieter Maurer) Date: Fri Apr 23 17:37:59 2004 Subject: [ZPT] Re: Entities in Attributes In-Reply-To: <4088FB5B.2030806@yahoo.de> References: <16520.18058.326947.896982@gargle.gargle.HOWL> <4088FB5B.2030806@yahoo.de> Message-ID: <16521.22001.229710.386634@gargle.gargle.HOWL> Tonico Strasser wrote at 2004-4-23 13:17 +0200: > ... >> In a private copy, I implemented the "structure" keyword that >> prevents escaping in a similar way to "tal:content". > >Would like to see it in future TAL versions. There has been a hot discussion about such a feature in this mailing list. Almost all participants (except me, of course) had strong objections against the word "structure". In may view, "structure" means "keep HTML structural elements" in the value (rather than escape them). This is senseful for both content as well as attributes. However, the strong objections almost surely mean: you will not see "structure" for attributes. Maybe, you will get the non-escaping functionality with a different keyword... -- Dieter From andreas at andreas-jung.com Sat Apr 24 03:32:40 2004 From: andreas at andreas-jung.com (Andreas Jung) Date: Sat Apr 24 07:35:13 2004 Subject: [ZPT] Re: Entities in Attributes In-Reply-To: <16521.22001.229710.386634@gargle.gargle.HOWL> References: <16520.18058.326947.896982@gargle.gargle.HOWL> <4088FB5B.2030806@yahoo.de> <16521.22001.229710.386634@gargle.gargle.HOWL> Message-ID: <2147483647.1082799160@[192.168.0.105]> --On Freitag, 23. April 2004 19:44 Uhr +0200 Dieter Maurer wrote: > There has been a hot discussion about such a feature in this > mailing list. > > Almost all participants (except me, of course) had strong > objections against the word "structure". > In may view, "structure" means "keep HTML structural elements" in > the value (rather than escape them). This is senseful for both > content as well as attributes. > A discussion about names is one thing, having this feature or having it not is another thing. I am +10 to include this functionality finally in ZPT as soon as possible. Why? - newbies don't understand why 'structure works only for tal:content|replace - newbies have problems to workaround the quoting problem - the workarounds are ugly and are usually not intuitive For the sake of simplicity und usability I would like restart this discussion about this feature again, not about the name. If you don't like 'structure' call it 'bob' or 'foobar'. Andreas From maxm at mxm.dk Sat Apr 24 04:10:18 2004 From: maxm at mxm.dk (Max M) Date: Sat Apr 24 07:38:08 2004 Subject: [ZPT] Re: Adding users in Plone 2.0 Programmatically? In-Reply-To: <28A471EF3151244187A887958F39415D0D95AFE6@nhqjexc02.nam.coair.com> References: <28A471EF3151244187A887958F39415D0D95AFE6@nhqjexc02.nam.coair.com> Message-ID: Nguyen, Joe wrote: > How would I go about adding a user (members) programmatically in plone 2 > with their name, password, roles, and domains as fields? > > I used this script in plone 1.05. It still looks sane. Why can't you use it anymore? regards Max M From chris at simplistix.co.uk Sat Apr 24 12:36:44 2004 From: chris at simplistix.co.uk (Chris Withers) Date: Sat Apr 24 12:36:47 2004 Subject: [ZPT] Re: Adding users in Plone 2.0 Programmatically? In-Reply-To: References: <28A471EF3151244187A887958F39415D0D95AFE6@nhqjexc02.nam.coair.com> Message-ID: <408A979C.7040006@simplistix.co.uk> Max M wrote: > Nguyen, Joe wrote: > >> How would I go about adding a user (members) programmatically in plone 2 >> with their name, password, roles, and domains as fields? >> >> I used this script in plone 1.05. > > It still looks sane. Why can't you use it anymore? More to the point, why not ask on the Plone list where people might actually have a clue how to help you ;-) Chrus -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Sat Apr 24 12:40:39 2004 From: chris at simplistix.co.uk (Chris Withers) Date: Sat Apr 24 12:40:48 2004 Subject: [ZPT] Re: Entities in Attributes In-Reply-To: <2147483647.1082799160@[192.168.0.105]> References: <16520.18058.326947.896982@gargle.gargle.HOWL> <4088FB5B.2030806@yahoo.de> <16521.22001.229710.386634@gargle.gargle.HOWL> <2147483647.1082799160@[192.168.0.105]> Message-ID: <408A9887.6020802@simplistix.co.uk> Andreas Jung wrote: > A discussion about names is one thing, having this feature or having it > not is another thing. > I am +10 to include this functionality finally in ZPT as soon as > possible. Me too! > For the sake of simplicity und usability I would like restart this > discussion about > this feature again, not about the name. If you don't like 'structure' > call it 'bob' or > 'foobar'. I think structure is just fine. In any case, both words, whatever they are, should be the same. I've never found structure particularly descriptive, even in its original use. noquote seemed much better to me. BUT, structure is there now, and i see no reason to change it, so I'm +10 on structrue for both uses, so we can get this in for 2.8.... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From jim at microbrightfield.com Sat Apr 24 13:20:55 2004 From: jim at microbrightfield.com (James Carroll) Date: Sat Apr 24 13:21:02 2004 Subject: [ZPT] complex macro usage Message-ID: <5EA4B2EDD4BA8B4C84BE11298F81ADC4067982@exchange.microbrightfield.com> Hi, I'd like to do something that is probably too complex for a metal:define-macro. I've got a complex set of javascript and html for a javascript date selector, and it would be great to get the complexity out of my page templates. I'd like to do something like the (invalid) following code: " tal:define="idname string:${name}id" tal:define="buttonname string:${name}button" tal:define="initalValue "> In here I would use name, idname, buttonname and initalvalue repeatedly, including inside some dynamically generated javascript. (I've pasted the complex stuff below.) Even though I would like to use macros for this sort of thing, I think it's too complex to ever work. I'm thinkning of doing it with a python script, then I would but this doesn't seem right either. I'm coming from a background of some complex JavaWebComponents in the Tapestry framework. What's the best way to do this sort of thing? The real body of my macro is something like: So you see I have a lot of javascript where I probably can't use metal:fill-slot. Thanks in advance! -Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040424/fd243df1/attachment.html From fernando at cmartins.demon.nl Tue Apr 27 17:44:58 2004 From: fernando at cmartins.demon.nl (Fernando Martins) Date: Tue Apr 27 17:47:05 2004 Subject: [ZPT] complex macro usage In-Reply-To: <5EA4B2EDD4BA8B4C84BE11298F81ADC4067982@exchange.microbrightfield.com> Message-ID: Hi, please avoid HTML messages in this list. You have no idea how bad it looks in my side ;-) Honestly, I don't quite get what you want not even what do you perceive as complex, but as you got no other reply so far, I'll do some guess work. It seems your problem is to pass some arguments (variables) to a macro. This doesn't work because macros are coarse grained: you can only pass through entire HTML elements. You should also keep in mind that macros are not running code, it's just a way to do string replacemente; the concept of subroutines or variables doesn't really apply here. The trick to overcome this is to put your variables in the HTML elements above (tree speaking) the element having the use-macro. These variables must have the same name as the ones in the macro so that when your macro is used ("imported") all the names match up. HTH, Fernando James Carroll wrote: ======================= Hi, I'd like to do something that is probably too complex for a metal:define-macro. I've got a complex set of javascript and html for a javascript date selector, and it would be great to get the complexity out of my page templates. I'd like to do something like the (invalid) following code: " tal:define="idname string:${name}id" tal:define="buttonname string:${name}button" tal:define="initalValue "> In here I would use name, idname, buttonname and initalvalue repeatedly, including inside some dynamically generated javascript. (I've pasted the complex stuff below.) Even though I would like to use macros for this sort of thing, I think it's too complex to ever work. I'm thinkning of doing it with a python script, then I would but this doesn't seem right either. I'm coming from a background of some complex JavaWebComponents in the Tapestry framework. What's the best way to do this sort of thing? The real body of my macro is something like: So you see I have a lot of javascript where I probably can't use metal:fill-slot. Thanks in advance! -Jim From daniel at velir.com Wed Apr 28 14:21:28 2004 From: daniel at velir.com (Daniel DeLay) Date: Wed Apr 28 14:21:39 2004 Subject: [ZPT] changing zope to UTF-8 Message-ID: Hi, We are trying to get zope to default to UTF-8, but we are having some stickyness. - We do have the localizer installed, all the languages are set to UTF-8. - We do have a meta tag in our header template which specifies UTF-8. However in IE, when I go to View->Encoding it says Western European (ISO). Is there something we missed, any help is great! - Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040428/cd493a51/attachment.html From andreas at andreas-jung.com Wed Apr 28 18:23:48 2004 From: andreas at andreas-jung.com (Andreas Jung) Date: Wed Apr 28 18:23:57 2004 Subject: [ZPT] changing zope to UTF-8 In-Reply-To: References: Message-ID: Try to send the charset also within your http headers (hint: RESPONSE.setHeader()) -aj --On Mittwoch, 28. April 2004 14:21 Uhr -0400 Daniel DeLay wrote: > Hi, > > We are trying to get zope to default to UTF-8, but we are > having some stickyness. > > > > - We do have the localizer installed, all the languages are set to UTF-8. > > > > - We do have a meta tag in our header template which specifies UTF-8. > > > > However in IE, when I go to View->Encoding it says Western European (ISO). > > > > Is there something we missed, any help is great! > > > > - Daniel > > > > > > > From daniel at velir.com Wed Apr 28 21:11:33 2004 From: daniel at velir.com (Daniel DeLay) Date: Wed Apr 28 21:11:38 2004 Subject: [ZPT] changing zope to UTF-8 References: Message-ID: <000b01c42d86$e9550fb0$b7737392@daniel61bhm93c> Thanks Andreas, we did that and it worked like a charm! :-) - Daniel ----- Original Message ----- From: "Andreas Jung" To: "Daniel DeLay" ; Sent: Wednesday, April 28, 2004 6:23 PM Subject: Re: [ZPT] changing zope to UTF-8 > Try to send the charset also within your http headers (hint: > RESPONSE.setHeader()) > > -aj > > --On Mittwoch, 28. April 2004 14:21 Uhr -0400 Daniel DeLay > wrote: > > > Hi, > > > > We are trying to get zope to default to UTF-8, but we are > > having some stickyness. > > > > > > > > - We do have the localizer installed, all the languages are set to UTF-8. > > > > > > > > - We do have a meta tag in our header template which specifies UTF-8. > > > > > > > > However in IE, when I go to View->Encoding it says Western European (ISO). > > > > > > > > Is there something we missed, any help is great! > > > > > > > > - Daniel > > > > > > > > > > > > > > > > > > > > From uprety_vaibhav at rediffmail.com Thu Apr 29 05:16:01 2004 From: uprety_vaibhav at rediffmail.com (vaibhav uprety) Date: Thu Apr 29 05:58:48 2004 Subject: [ZPT] (no subject) Message-ID: <20040429091601.2015.qmail@webmail36.rediffmail.com> An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040429/c074649e/attachment.html -------------- next part -------------- ? From charlie at egenix.com Thu Apr 29 08:41:16 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Apr 29 08:41:20 2004 Subject: [ZPT] Re: Re: [Zope-DB] How to pass values from a form to a page template? In-Reply-To: <20040429093002.31498.qmail@webmail25.rediffmail.com> References: <20040429093002.31498.qmail@webmail25.rediffmail.com> Message-ID: <20040429144116.8916.64@wonderland.1083137439.fake> Vaibhav, it is always best to post to a list. I'm transferring this to zpt though as it is not related to databases. You might also want to sign up to a Plone list as there may be other ways of doing this. On 2004-04-29 at 11:30:02 [+0200], you wrote: > Dear Charlie, > > I have made a DTML document storing the name of some books > which i have to post to a Page template > here is the coding for the DTML Document. > > > >

Assign Privileges To book

> > PLONE BOOK > >

> > > in this DTML Document Drop DTML and just use PageTemplates. > 1. the options specified by the select tag are some of the roles defined by > me. > 2. access2 is the Page template to which this value is to be passed This will give you a Zope-Request object which contains the values of the form like a dictionary, ie. request.attr1 or request.form.attr1 will give you the appropriate value. > here is the code for access2 > ---------------------------------------------------------------------------- > ------------------------------------- > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > lang="en-US" > metal:use-macro="here/main_template/macros/master"> > > > > > > > ---------------------------------------------------------------------------- > ------------------------------ > > now i want that the link to the book to be displayed by the page template > on the basis of value of 'attr1' passed > to it by the form i.e the python conditional statement which checks for > role should decide the role > based on the value passed to it. You should do this using a PythonScript but I think you may well need to rethink your application. But anyway here's some code If you want to make what the user sees dependent on what role they have then you will are best using a PythonScript as if/elif is very clumsy in ZPT especially compared to "dispatching" in Python. > Please help me!!!! Hope I have a bit. Charlie Clark -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From uprety_vaibhav at yahoo.co.in Fri Apr 30 01:37:25 2004 From: uprety_vaibhav at yahoo.co.in (=?iso-8859-1?q?vaibhav=20uprety?=) Date: Fri Apr 30 01:37:41 2004 Subject: [ZPT] How to pass values from a form to a page template? Message-ID: <20040430053725.72768.qmail@web8203.mail.in.yahoo.com> Hi, I have made a DTML document storing the name of some books which i have to post to a Page template here is the coding for the DTML Document.

Assign Privileges To book

PLONE BOOK

in this DTML Document 1. the options specified by the select tag are some of the roles defined by me. 2. access2 is the Page template to which this value is to be passed here is the code for access2 ----------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------- now i want that the link to the book to be displayed by the page template on the basis of value of 'attr1' passed to it by the form i.e the python conditional statement which checks for role should decide the role based on the value passed to it. But here comes the problem since i log in using the login_form, it although authenticates the user but when it redirects to access2 the value of 'attr1' becomes undefined as login_form posts no such value to access2 Please help me to correct this problem. Thanks in advance Vaibhav Yahoo! India Matrimony: Find your partner online. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20040430/3c389356/attachment.html From genericplayer at uoxng.org Fri Apr 30 18:50:53 2004 From: genericplayer at uoxng.org (Adam) Date: Fri Apr 30 18:50:58 2004 Subject: [ZPT] concatenating strings in tal:attributes? Message-ID: <20040430225053.GA15236@mail.my-balls.com> I would like to do something like this: blah The idea being that I would get a resulting url like "mysite/fish?content=trout" I can't seem to figure out what the correct way to do this would be though, and I don't see anything like this in any of the zpt docs. Adam From jamie at audible.transient.net Fri Apr 30 18:58:46 2004 From: jamie at audible.transient.net (Jamie Heilman) Date: Fri Apr 30 18:59:11 2004 Subject: [ZPT] concatenating strings in tal:attributes? In-Reply-To: <20040430225053.GA15236@mail.my-balls.com> References: <20040430225053.GA15236@mail.my-balls.com> Message-ID: <20040430225846.GB22872@audible.transient.net> Adam wrote: > I would like to do something like this: > blah > > The idea being that I would get a resulting url like "mysite/fish?content=trout" tal:attributes="href string:${folders/absolute_url}?content=${docs/id}" From genericplayer at uoxng.org Fri Apr 30 23:07:22 2004 From: genericplayer at uoxng.org (Adam) Date: Fri Apr 30 23:07:25 2004 Subject: [ZPT] forcing a string to be a path Message-ID: <20040501030722.GC16449@mail.my-balls.com> I am attempting to include different content based on a variable in the url, fish?content=trout. In my template doing something like: content goes here ends up replacing the tag with the string "trout" instead of the contents of the file named trout. I thought I could work around this by forcing it to be interpreted as a path using path:request/content, but that didn't actually change anything. Is there a way to include a file based on a variable like this? Thanks Adam
Customer Name
and
left columnright column
Note that spans are not technically allowed outside cells in tables...