From chris at simplistix.co.uk Tue Nov 1 04:53:53 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Tue Nov 1 05:53:38 2005 Subject: [ZPT] Emacs mode for ZPT In-Reply-To: <1130817481.3358.41.camel@localhost.localdomain> References: <1130817481.3358.41.camel@localhost.localdomain> Message-ID: <43673B31.1090107@simplistix.co.uk> Rakotomandimby Mihamina wrote: > What Emacs mode do Emacs users use for ZPT editiion? > I mostly think about syntax highlighting. > Just SGML-mode, or what? Yup. Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From mail2cajit at gmail.com Wed Nov 2 01:34:13 2005 From: mail2cajit at gmail.com (ajit mote) Date: Wed Nov 2 01:48:41 2005 Subject: [ZPT] object attribute Message-ID: Hello, while reading 2.6Zope book i meet term attribute..... but not able to u'stand how to specify attribute ..... if possible please give code for the below through attribute .... suppose i want to retrive the list of my friend's and display them ..... and my best friend's name in bold ..... so i decided to use attribute in this above case but not able to put that in code.... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051102/f0f34702/attachment.htm From mail2cajit at gmail.com Wed Nov 2 01:46:03 2005 From: mail2cajit at gmail.com (ajit mote) Date: Wed Nov 2 02:00:30 2005 Subject: [ZPT] what string: ? Message-ID: error message what is string: mean ? .... i mean namespace or ..... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051102/7edde9bf/attachment.htm From mail2cajit at gmail.com Wed Nov 2 02:46:53 2005 From: mail2cajit at gmail.com (ajit mote) Date: Wed Nov 2 03:01:21 2005 Subject: [ZPT] can we access REQUEST object in page template? Message-ID: can we access REQUEST object in page template? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051102/595fdd9e/attachment.htm From tino at wildenhain.de Wed Nov 2 14:59:33 2005 From: tino at wildenhain.de (Tino Wildenhain) Date: Wed Nov 2 15:14:04 2005 Subject: [ZPT] can we access REQUEST object in page template? In-Reply-To: References: Message-ID: <1130961573.30174.21.camel@Andrea.peacock.de> Am Mittwoch, den 02.11.2005, 13:16 +0530 schrieb ajit mote: > can we access REQUEST object in page template? its request. See Zope-book about the variables and namespaces available. From phil at xfr.co.uk Wed Nov 2 15:10:08 2005 From: phil at xfr.co.uk (Philip Kilner) Date: Wed Nov 2 15:25:53 2005 Subject: [ZPT] object attribute In-Reply-To: References: Message-ID: <43691D20.1010206@xfr.co.uk> Hi Ajit, ajit mote wrote: > while reading 2.6Zope book i meet term attribute..... > but not able to u'stand how to specify attribute ..... > > if possible please give code for the below through attribute .... > suppose i want to retrive the list of my friend's and display > them ..... > and my best friend's name in bold ..... > so i decided to use attribute in this above case but not able > to put that in code.... > The "tal:attribute" tag lets you set the attributes of an HTML element. If you look at the examples in the Zope book (The latest and greatest is at http://www.plope.com/Books/2_7Edition), the example is of an "href" attribute being set: - So, the first question might be "how should I put my friends name in bold?". I'm not sure this is a great example, because bold is a tag, not an attribute. However, let's say you have decided to use CSS, and so you want to set the class attribute. A frequent case in which a class is set as an attribute is setting a different class for odd and even rows: - In this example, a variable is defined ("oddrow") to hold the value being tested (it could be where you define your friends name). Then the "tal:attributes" expression sets the value of the "class" attribute to a value based on a test of the value in the variable. Translating this into your use-case, you would need to set a variable to true/false by testing for your friends name, and then set the class attribute based on that. If the true/false variable was "IsFriend", you might do (untested): - Your data ...such that if the variable were true you would get: - Your data HTH -- Regards, PhilK Email: phil@xfr.co.uk PGP Public key: http://www.xfr.co.uk Voicemail & Facsimile: 07092 070518 "You'll find that one part's sweet and one part's tart: say where the sweetness and the sourness start." - Tony Harrison From phil at xfr.co.uk Wed Nov 2 15:14:06 2005 From: phil at xfr.co.uk (Philip Kilner) Date: Wed Nov 2 15:29:05 2005 Subject: [ZPT] can we access REQUEST object in page template? In-Reply-To: References: Message-ID: <43691E0E.1070705@xfr.co.uk> Hi Ajit, ajit mote wrote: > can we access REQUEST object in page template? > Yes - use a TALES path expression, see: - http://www.plope.com/Books/2_7Edition/AppendixC.stx#2-57 e.g. request/form/field HTH -- Regards, PhilK Email: phil@xfr.co.uk PGP Public key: http://www.xfr.co.uk Voicemail & Facsimile: 07092 070518 "You'll find that one part's sweet and one part's tart: say where the sweetness and the sourness start." - Tony Harrison From phil at xfr.co.uk Wed Nov 2 15:28:34 2005 From: phil at xfr.co.uk (Philip Kilner) Date: Wed Nov 2 15:43:29 2005 Subject: [ZPT] what string: ? In-Reply-To: References: Message-ID: <43692172.2020508@xfr.co.uk> Hi Ajit, ajit mote wrote: > error message > > what is string: mean ? .... > i mean namespace or ..... > Yes - "string:" is a namespace declaration, as would be "python:". -- Regards, PhilK Email: phil@xfr.co.uk PGP Public key: http://www.xfr.co.uk Voicemail & Facsimile: 07092 070518 "You'll find that one part's sweet and one part's tart: say where the sweetness and the sourness start." - Tony Harrison From fg at nuxeo.com Wed Nov 2 18:10:30 2005 From: fg at nuxeo.com (Florent Guillaume) Date: Wed Nov 2 18:25:02 2005 Subject: [ZPT] Re: Emacs mode for ZPT In-Reply-To: <1130817481.3358.41.camel@localhost.localdomain> References: <1130817481.3358.41.camel@localhost.localdomain> Message-ID: <43694766.6010307@nuxeo.com> Rakotomandimby Mihamina wrote: > What Emacs mode do Emacs users use for ZPT editiion? > I mostly think about syntax highlighting. > Just SGML-mode, or what? nxml-mode Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com From mail2cajit at gmail.com Wed Nov 2 23:34:46 2005 From: mail2cajit at gmail.com (ajit mote) Date: Wed Nov 2 23:49:17 2005 Subject: [ZPT] what string: ? In-Reply-To: <43692172.2020508@xfr.co.uk> References: <43692172.2020508@xfr.co.uk> Message-ID: Thanks..... Regards, Ajit Mote. On 11/3/05, Philip Kilner wrote: > > Hi Ajit, > > ajit mote wrote: > > error message > > > > what is string: mean ? .... > > i mean namespace or ..... > > > > Yes - "string:" is a namespace declaration, as would be "python:". > > > -- > > Regards, > > PhilK > > Email: phil@xfr.co.uk > PGP Public key: http://www.xfr.co.uk > Voicemail & Facsimile: 07092 070518 > > "You'll find that one part's sweet and one part's tart: > say where the sweetness and the sourness start." > - Tony Harrison > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051103/a04e6920/attachment.htm From mail2cajit at gmail.com Wed Nov 2 23:52:19 2005 From: mail2cajit at gmail.com (ajit mote) Date: Thu Nov 3 00:06:50 2005 Subject: [ZPT] mailing list ? Message-ID: Hi all, only reply to my mail are coming to my account ( mail ).... not able to view other mail's please take kind note of this .... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051103/14ff6cb5/attachment.htm From tino at wildenhain.de Thu Nov 3 01:34:21 2005 From: tino at wildenhain.de (Tino Wildenhain) Date: Thu Nov 3 01:49:01 2005 Subject: [ZPT] can we access REQUEST object in page template? In-Reply-To: References: <1130961573.30174.21.camel@Andrea.peacock.de> Message-ID: <1130999662.30174.29.camel@Andrea.peacock.de> Am Donnerstag, den 03.11.2005, 10:07 +0530 schrieb ajit mote: > > > On 11/3/05, Tino Wildenhain wrote: > Am Mittwoch, den 02.11.2005, 13:16 +0530 schrieb ajit mote: > > can we access REQUEST object in page template? > > its request. See Zope-book about the variables > and namespaces available. > > > hi > > i access the request object in template but by using python: > namespace..... > my prob was that can we do it purly in page template tag's... Purly? What do you mean? You should always try to restrict yourself to path expressions, meaning no string: or python: prefix. Do your logic _outside_ of your template. (By means of python scripts) From mail2cajit at gmail.com Thu Nov 3 05:08:44 2005 From: mail2cajit at gmail.com (ajit mote) Date: Thu Nov 3 05:30:03 2005 Subject: [ZPT] useradd command in Zope Message-ID: Hi , how to use command that require Root privileges like useradd,reading shadow file.... bca'z i install zope as non root user.... now i need to use useradd command in my application.... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051103/d23ce292/attachment.htm From tino at wildenhain.de Thu Nov 3 05:28:05 2005 From: tino at wildenhain.de (Tino Wildenhain) Date: Thu Nov 3 05:42:50 2005 Subject: [ZPT] useradd command in Zope In-Reply-To: References: Message-ID: <4369E635.4020305@wildenhain.de> ajit mote schrieb: > Hi , > > how to use command that require Root privileges like > useradd,reading shadow file.... > bca'z i install zope as non root user.... > now i need to use useradd command in my application.... No, you dont do that with zope :-) The whole point of zope is to _not_ be able to do that from aout of the management interface. You can however use a suid wrapper (sudo) and an external method. General zope questions however are to be sent to the dedicated zope@zope.org list, not ZPT. Please configure your mail client in any case to write to mailinglists in text only! Regards Tino From mail2cajit at gmail.com Thu Nov 3 06:38:23 2005 From: mail2cajit at gmail.com (ajit mote) Date: Thu Nov 3 06:59:38 2005 Subject: [ZPT] useradd command in Zope In-Reply-To: <4369E635.4020305@wildenhain.de> References: <4369E635.4020305@wildenhain.de> Message-ID: can i add and delete zope user through page template.... if yes and possible , sample code for the same is appreciated... On 11/3/05, Tino Wildenhain wrote: > > ajit mote schrieb: > > Hi , > > > > how to use command that require Root privileges like > > useradd,reading shadow file.... > > bca'z i install zope as non root user.... > > now i need to use useradd command in my application.... > > No, you dont do that with zope :-) > The whole point of zope is to _not_ be able to do that > from aout of the management interface. > > You can however use a suid wrapper (sudo) and an > external method. > > General zope questions however are to be sent to > the dedicated zope@zope.org list, not ZPT. > > Please configure your mail client in any case > to write to mailinglists in text only! > > Regards > Tino > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051103/09ee4535/attachment-0001.htm From tino at wildenhain.de Thu Nov 3 06:52:55 2005 From: tino at wildenhain.de (Tino Wildenhain) Date: Thu Nov 3 07:07:40 2005 Subject: [ZPT] Re: useradd command in Zope In-Reply-To: References: <4369E635.4020305@wildenhain.de> Message-ID: <4369FA17.6010701@wildenhain.de> ajit mote schrieb: > can i add and delete zope user through page template.... > if yes and possible , sample code for the same is appreciated... > No you cant :) And a page template is the least place to do so anyway. You would need an external method for it. But first rethink if you really can handle that. If you have your zope only available to your internal network and/or secure it with ssl. If not, you should not try such things. For starters, get some more simple project where you can get ground on zope development. From mail2cajit at gmail.com Thu Nov 3 07:00:19 2005 From: mail2cajit at gmail.com (ajit mote) Date: Thu Nov 3 07:21:57 2005 Subject: [ZPT] Re: useradd command in Zope In-Reply-To: <4369FA17.6010701@wildenhain.de> References: <4369E635.4020305@wildenhain.de> <4369FA17.6010701@wildenhain.de> Message-ID: i create external methode(python) which create user .... this script works fine when i run it from shell .... but when i am using the same script thourgh zope it is returning 256 and not creating system user and also not giving any error.... On 11/3/05, Tino Wildenhain wrote: > > ajit mote schrieb: > > can i add and delete zope user through page template.... > > if yes and possible , sample code for the same is appreciated... > > > No you cant :) And a page template is the least place to > do so anyway. > > You would need an external method for it. > > But first rethink if you really can handle that. > > If you have your zope only available to your internal > network and/or secure it with ssl. If not, you should > not try such things. > > For starters, get some more simple project where > you can get ground on zope development. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051103/d0fbc234/attachment.htm From dieter at handshake.de Thu Nov 3 13:10:13 2005 From: dieter at handshake.de (Dieter Maurer) Date: Thu Nov 3 13:45:53 2005 Subject: [ZPT] Emacs mode for ZPT In-Reply-To: <1130817481.3358.41.camel@localhost.localdomain> References: <1130817481.3358.41.camel@localhost.localdomain> Message-ID: <17258.21125.93739.617745@gargle.gargle.HOWL> Rakotomandimby Mihamina wrote at 2005-11-1 04:58 +0100: >What Emacs mode do Emacs users use for ZPT editiion? >I mostly think about syntax highlighting. I use HTML mode (and get HTML syntax highlighting). -- Dieter From jim at zope.com Tue Nov 8 16:11:39 2005 From: jim at zope.com (Jim Fulton) Date: Tue Nov 8 16:11:42 2005 Subject: [ZPT] i18n:translate and tal:content should not use template domain Message-ID: <4371148B.5040906@zope.com> IMO, if a template an element with both i18n:translate and tal:content and the value inserted is not a message id, the template's domain will be used. This seems like a bad idea. It can hide failures to provide message ids because everything ultimately gets a domain. I'm working on tools to help people see when text hasn't been internationalized and the implicit use of of the template's domain makes these tools less useful. Basically, the domain given in the template source applies to the source only and shouldn't be used for data coming from elsewhere. I propose that we should never use the templates domain when inserting data via tal:content. Note however, if the tal expression results in the use of the template's example text, the templates domain should be used. Thoughts? Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org From pascal.deoliveira at gmail.com Fri Nov 11 06:59:54 2005 From: pascal.deoliveira at gmail.com (Pascal De Oliveira) Date: Fri Nov 11 06:59:56 2005 Subject: [ZPT] Bug in ZPT ? Message-ID: <1158d5510511110359g2ad58cd7jc13cc0f018e8f70b@mail.gmail.com> I found a strange thing in ZPT and I'd like you to confirm whether the bug is in ZPT or in my understanding ... I'd like to put in the 'value' attribute of an input tag a value depending on the content of a member variable. If I use the following code : everything is OK and I get the following results : [path]?member=NEW --> new [path]?member=member_00000000 --> member_00000000 but if I use the following code : I get the following results which are wrong : [path]?member=NEW --> Error Type: KeyError / Error Value: 'NEW' [path]?member=member_00000000 --> DE OLIVEIRA I don't understand why the 'true' part of the test() generated an error while I have just changed the 'false' part of it (and this 'false' part is valid as I get a good result when 'member' is not 'NEW') ? So, is it a bug and if so, is there a workaround ? Thank you for your help, pascal de oliveira -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051111/9ba269a5/attachment.htm From pascal.deoliveira at gmail.com Fri Nov 11 12:15:24 2005 From: pascal.deoliveira at gmail.com (Pascal De Oliveira) Date: Fri Nov 11 12:15:26 2005 Subject: [ZPT] CANCEL: Bug in ZPT ? Message-ID: <1158d5510511110915s4a607169v6c265bc8b624612b@mail.gmail.com> I finally understood what was wrong : The 'true' and 'false' parameters of the test() function are evaluated before calling. I have to redesign my screen ... pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zpt/attachments/20051111/5a677954/attachment.htm From dieter at handshake.de Fri Nov 11 15:05:45 2005 From: dieter at handshake.de (Dieter Maurer) Date: Fri Nov 11 15:12:20 2005 Subject: [ZPT] Bug in ZPT ? In-Reply-To: <1158d5510511110359g2ad58cd7jc13cc0f018e8f70b@mail.gmail.com> References: <1158d5510511110359g2ad58cd7jc13cc0f018e8f70b@mail.gmail.com> Message-ID: <17268.63897.520254.541385@gargle.gargle.HOWL> Pascal De Oliveira wrote at 2005-11-11 12:59 +0100: > ... >python:test(request['member']=='NEW','new',context[request['member']].LastName)"> >I get the following results which are wrong : >[path]?member=NEW --> Error Type: KeyError / Error Value: 'NEW' >[path]?member=member_00000000 --> DE OLIVEIRA > >I don't understand why the 'true' part of the test() generated an error >while I have just changed the 'false' part of it (and this 'false' part is >valid as I get a good result when 'member' is not 'NEW') ? Keep in mind that "test" is a standard Python function. Any standard Python function evaluates all of its arguments before the function is called. That's why the "false" part is evaluated even though the "condition" is true. Use Python's "and" and "or" operators to get real conditional evaluation. Rumours say that Python will finally (probably with Python 2.5) grow a conditional operator -- lately overdue... Then the need for "test" and the "and/or" hackery will end... -- Dieter From chris at simplistix.co.uk Tue Nov 15 05:48:41 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Tue Nov 15 05:48:52 2005 Subject: [ZPT] Bug in ZPT ? In-Reply-To: <17268.63897.520254.541385@gargle.gargle.HOWL> References: <1158d5510511110359g2ad58cd7jc13cc0f018e8f70b@mail.gmail.com> <17268.63897.520254.541385@gargle.gargle.HOWL> Message-ID: <4379BD09.5010905@simplistix.co.uk> Dieter Maurer wrote: > Rumours say that Python will finally (probably with Python 2.5) > grow a conditional operator -- lately overdue... Yeah, sadly, IIRC, the spelling is horrible :-( Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From jean at upfrontsystems.co.za Thu Nov 24 03:30:56 2005 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Thu Nov 24 03:31:06 2005 Subject: [ZPT] what string: ? In-Reply-To: <43692172.2020508@xfr.co.uk> References: <43692172.2020508@xfr.co.uk> Message-ID: <43857A40.9040506@upfrontsystems.co.za> >> error message >> >> what is string: mean ? .... >> i mean namespace or ..... > > Yes - "string:" is a namespace declaration, as would be "python:". Strictly speaking, "string:" is not a namespace declaration in the XML sense. Those can only occur before tags or attributes, not inside the value of an attribute. In the page template sense, "string:" is a TALES (Template Attribute Language Expression Syntax). From http://www.plope.com/Books/2_7Edition/AppendixC.stx#1-10 """ Here is the basic definition of TALES syntax: Expression ::= [type_prefix ':'] String type_prefix ::= Name Here are some simple examples: a/b/c path:a/b/c nothing path:nothing python: 1 + 2 string:Hello, ${user/getUserName} The optional type prefix determines the semantics and syntax of the expression string that follows it. A given implementation of TALES can define any number of expression types, with whatever syntax you like. It also determines which expression type is indicated by omitting the prefix. If you do not specify a prefix, Zope assumes that the expression is a path expression. """ -- Jean Jordaan http://www.upfrontsystems.co.za From plasser at hexagon.at Fri Nov 25 05:27:13 2005 From: plasser at hexagon.at (=?ISO-8859-1?Q?=22J=FCrgen_R=2E_Plasser=22?=) Date: Fri Nov 25 05:27:19 2005 Subject: [ZPT] CDATA section in zpt Message-ID: <4386E701.30904@hexagon.at> How can I accomplish a CDATA section in page templates? The following does not work: ]]> What am I missing here? -J?rgen From chris at simplistix.co.uk Fri Nov 25 07:48:30 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Fri Nov 25 07:48:34 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <4386E701.30904@hexagon.at> References: <4386E701.30904@hexagon.at> Message-ID: <4387081E.1000102@simplistix.co.uk> The TAL interpretter parses the source of hte ZPT as XML, and so doesn't do anything with CDATA sections. Annoying, isn't it? ;-) Chris J?rgen R. Plasser wrote: > How can I accomplish a CDATA section in page templates? > > The following does not work: > > > > ]]> > > > What am I missing here? > > -J?rgen > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://mail.zope.org/mailman/listinfo/zpt > -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From plasser at hexagon.at Fri Nov 25 08:38:51 2005 From: plasser at hexagon.at (=?ISO-8859-1?Q?=22J=FCrgen_R=2E_Plasser=22?=) Date: Fri Nov 25 08:38:58 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <4387081E.1000102@simplistix.co.uk> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> Message-ID: <438713EB.7060800@hexagon.at> Chris Withers wrote: > The TAL interpretter parses the source of hte ZPT as XML, and so doesn't > do anything with CDATA sections. Better do it with a Python script ... > > Annoying, isn't it? ;-) Yep :-( From dieter at handshake.de Fri Nov 25 16:05:23 2005 From: dieter at handshake.de (Dieter Maurer) Date: Fri Nov 25 16:17:11 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <4387081E.1000102@simplistix.co.uk> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> Message-ID: <17287.31891.862739.28120@gargle.gargle.HOWL> Chris Withers wrote at 2005-11-25 12:48 +0000: >The TAL interpretter parses the source of hte ZPT as XML, and so doesn't > do anything with CDATA sections. But XML knows about "CDATA" sections and an XML compatible parser should handle them correctly. -- Dieter From fergal at esatclear.ie Fri Nov 25 19:42:57 2005 From: fergal at esatclear.ie (Fergal Daly) Date: Fri Nov 25 19:49:39 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <17287.31891.862739.28120@gargle.gargle.HOWL> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> <17287.31891.862739.28120@gargle.gargle.HOWL> Message-ID: <875029960511251642je6de8f3ic472e8aa81b3f455@mail.gmail.com> ]]> is essentially the same as <span tal:replace="..." /> so TAL doesn't see a element at all. It could be done with something like which has different escaping (which may actually be desirable) or to achieve identical escaping, F On 11/25/05, Dieter Maurer wrote: > Chris Withers wrote at 2005-11-25 12:48 +0000: > >The TAL interpretter parses the source of hte ZPT as XML, and so doesn't > > do anything with CDATA sections. > > But XML knows about "CDATA" sections and an XML compatible parser > should handle them correctly. > > -- > Dieter > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://mail.zope.org/mailman/listinfo/zpt > From plasser at hexagon.at Mon Nov 28 04:30:17 2005 From: plasser at hexagon.at (=?ISO-8859-1?Q?=22J=FCrgen_R=2E_Plasser=22?=) Date: Mon Nov 28 04:30:24 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <875029960511251642je6de8f3ic472e8aa81b3f455@mail.gmail.com> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> <17287.31891.862739.28120@gargle.gargle.HOWL> <875029960511251642je6de8f3ic472e8aa81b3f455@mail.gmail.com> Message-ID: <438ACE29.8040905@hexagon.at> Fergal Daly wrote: > > > ]]> > > > is essentially the same as > > > > <span tal:replace="..." /> > > > > so TAL doesn't see a element at all. It could be done with something like > > > > I had the same idea right after my e-mail to this list, but the RSS feed (of which this tag is a part of) worked fine without CDATA. When I build the feed with the string expression, structure does not work for me (error). And without structure the feed's content starts with a "[" and ends with a ">" in my feed reader. J?rgen From chris at simplistix.co.uk Mon Nov 28 05:27:32 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Mon Nov 28 05:27:36 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <17287.31891.862739.28120@gargle.gargle.HOWL> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> <17287.31891.862739.28120@gargle.gargle.HOWL> Message-ID: <438ADB94.6000500@simplistix.co.uk> Dieter Maurer wrote: > Chris Withers wrote at 2005-11-25 12:48 +0000: > >>The TAL interpretter parses the source of hte ZPT as XML, and so doesn't >> do anything with CDATA sections. > > But XML knows about "CDATA" sections and an XML compatible parser > should handle them correctly. Yes, it treats them "correctly" as CDATA and doesn't look for any tags, including tal: inside them... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From luca at wetron.es Mon Nov 28 06:11:12 2005 From: luca at wetron.es (Luca Olivetti) Date: Mon Nov 28 06:11:22 2005 Subject: [ZPT] render a macro from python code Message-ID: <438AE5D0.3070702@wetron.es> I'd like to render a macro from python code. I saw this recipe http://zopelabs.com/cookbook/1015014229 and instead of calling the macro_renderer template from dtml code I can simply call it from python (and it works), but is there a more direct way? (something like theTemplate.useMacro('macroname',param1='value2',param2='value2')). Bye -- Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 From fergal at esatclear.ie Mon Nov 28 13:13:46 2005 From: fergal at esatclear.ie (Fergal Daly) Date: Mon Nov 28 13:13:59 2005 Subject: [ZPT] CDATA section in zpt In-Reply-To: <438ACE29.8040905@hexagon.at> References: <4386E701.30904@hexagon.at> <4387081E.1000102@simplistix.co.uk> <17287.31891.862739.28120@gargle.gargle.HOWL> <875029960511251642je6de8f3ic472e8aa81b3f455@mail.gmail.com> <438ACE29.8040905@hexagon.at> Message-ID: <875029960511281013s30fac616qd957b37b1ca4c2c@mail.gmail.com> On 11/28/05, "J?rgen R. Plasser" wrote: > Fergal Daly wrote: > > > > > > > ]]> > > > > > > is essentially the same as > > > > > > > > <span tal:replace="..." /> > > > > > > > > so TAL doesn't see a element at all. It could be done with something like > > > > > > > > > > I had the same idea right after my e-mail to this list, but the RSS feed > (of which this tag is a part of) worked fine without CDATA. When I build > the feed with the string expression, structure does not work for me > (error). And without structure the feed's content starts with a "[" and > ends with a ">" in my feed reader. The CDATA should definitely not be a requirement, it is basically just a convenient way of expressing text without having to worry about escaping your s and &s. It's possible the construct above gives an error in your feed reader because the ${...} expression also has a CDATA section in it, but if you got it to work without CDATA then you needn't worry about it, F From dieter at handshake.de Mon Nov 28 14:54:13 2005 From: dieter at handshake.de (Dieter Maurer) Date: Mon Nov 28 15:00:38 2005 Subject: [ZPT] render a macro from python code In-Reply-To: <438AE5D0.3070702@wetron.es> References: <438AE5D0.3070702@wetron.es> Message-ID: <17291.24677.827025.156768@gargle.gargle.HOWL> Luca Olivetti wrote at 2005-11-28 12:11 +0100: >I'd like to render a macro from python code. >I saw this recipe http://zopelabs.com/cookbook/1015014229 and instead of >calling the macro_renderer template from dtml code I can simply call it >from python (and it works), but is there a more direct way? (something >like theTemplate.useMacro('macroname',param1='value2',param2='value2')). Macros were not designed to be executed by Python Scripts. You can, however, view them as programs and let them evaluate by an adequate "TALInterpreter". Not sure, that this is simpler than your current approach... -- Dieter From luca at wetron.es Wed Nov 30 02:56:38 2005 From: luca at wetron.es (Luca Olivetti) Date: Wed Nov 30 02:56:48 2005 Subject: [ZPT] render a macro from python code In-Reply-To: <17291.24677.827025.156768@gargle.gargle.HOWL> References: <438AE5D0.3070702@wetron.es> <17291.24677.827025.156768@gargle.gargle.HOWL> Message-ID: <438D5B36.8020700@wetron.es> En/na Dieter Maurer ha escrit: > Luca Olivetti wrote at 2005-11-28 12:11 +0100: >> I'd like to render a macro from python code. [....] > Macros were not designed to be executed by Python Scripts. Well, let me explain why I want to do that: I'm experimenting with kukit and azax (http://bubblenet.be/home/community-work/kukit-azax-details/) so I have a macro to be used as intended inside a page template, but I want to render the same macro in the (python) method invoked by azax (which in turn wraps it in an xml command to send to the browser so that it will only update the changed chunk on the page). It's working well enough *and* I didn't have to learn javascript ;-) > You can, however, view them as programs and let them evaluate > by an adequate "TALInterpreter". Not sure, that this is simpler > than your current approach... Then I'll just continue with the current approach ;-) Bye -- Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007