[ZPT] help
Davis, Dee
DEE.DAVIS at mosescone.com
Wed Aug 25 16:53:09 EDT 2004
Dee Davis
x28077
-----Original Message-----
From: zpt-request at zope.org [mailto:zpt-request at zope.org]
Sent: Wednesday, August 25, 2004 11:32 AM
To: zpt at zope.org
Subject: ZPT Digest, Vol 17, Issue 21
Send ZPT mailing list submissions to
zpt at zope.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.zope.org/mailman/listinfo/zpt
or, via email, send a message with subject or body 'help' to
zpt-request at zope.org
You can reach the person managing the list at
zpt-owner at zope.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ZPT digest..."
Today's Topics:
1. Re: Need help understanding TAL and METAL:fill-lots interac
tion (Stephen Nesbitt)
2. Re: Re: PageTemplateFile (Chris Withers)
3. Re: PageTemplateFile again. Why Antipersistent?? (Chris Withers)
4. Re: Re: PageTemplateFile (Axel M?ller)
5. Re: PageTemplateFile again. Why Antipersistent?? (Axel M?ller)
6. Re: PageTemplateFile again. Why Antipersistent?? (Chris Withers)
7. Re: Re: PageTemplateFile (Chris Withers)
8. Re: PageTemplateFile again. Why Antipersistent?? (Axel M?ller)
9. Re: Re: PageTemplateFile (Axel M?ller)
10. probleme with condition (gustav)
11. Re: probleme with condition (Axel M?ller)
12. Re: probleme with condition (Jeff Peterson)
----------------------------------------------------------------------
Message: 1
Date: Tue, 24 Aug 2004 10:11:05 -0700
From: Stephen Nesbitt <snesbitt at cobaltgroup.com>
Subject: Re: [ZPT] Need help understanding TAL and METAL:fill-lots
interac tion
To: zpt at zope.org
Message-ID: <200408241011.05641.snesbitt at cobaltgroup.com>
Content-Type: text/plain; charset="iso-8859-1"
Thanks Chris!
-steve
On Monday 23 August 2004 23:28, you wrote:
> Stephen Nesbitt wrote:
> > All:
> >
> > I'm probably missing something obvious, but how can I reference
> > a tal variable inside of a metal:fill-slot element? For
> > example:
> >
> > <div tal:define="projectName python:lookupName()" >
>
> This tal:define either needs to appear inside the metal:fill-slot
> or outside the metal:use-macro
>
> cheers,
>
> Chris
--
Stephen Nesbitt
Senior Configuration Management Engineer
The Cobalt Group
206.219.8271
snesbitt at cobaltgroup.com
------------------------------
Message: 2
Date: Wed, 25 Aug 2004 07:24:27 +0100
From: Chris Withers <cwithers at gmail.com>
Subject: Re: [ZPT] Re: PageTemplateFile
To: Axel M?ller <axel.mueller at amit-services.de>
Cc: zpt at zope.org
Message-ID: <412C309B.5080202 at gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Axel Müller wrote:
> This wouldn't work for me, because every root-folder would have the same
> "standardHeader":
> -----------
> class A:
> standardHeader = PageTemplateFile('Pfad/zu/standardHeader',globals())
> -----------
> It is making "standardHeader" a PageTemplateFile object as an
> class-attribute of A.
Woah, you need to go read about metal macros before trying anything else...
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
------------------------------
Message: 3
Date: Wed, 25 Aug 2004 07:26:05 +0100
From: Chris Withers <cwithers at gmail.com>
Subject: Re: [ZPT] PageTemplateFile again. Why Antipersistent??
To: Axel M?ller <axel.mueller at amit-services.de>
Cc: zpt at zope.org
Message-ID: <412C30FD.1030407 at gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Axel Müller wrote:
> Hi,
> I've got it.(for mor info please have a look at my last mail in Thread
> "PageTemplateFile").
>
> HtmlFile, ImageFile etc. can be added to instances in ZODB:
>
> setattr(self,'name',HTMLFile('asdfad',globals()))
>
> (replace HTMLFile as needed)
...but REALLY shouldn't. Seriously, that's not what they're designed for.
> But why is this nessesary and is there a way to pass this?
What you really want is to instantiate a normal PageTemplate object, set
it as the attribute of your class instance, and then call it's edit
method with the data you read off the filesystem.
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
------------------------------
Message: 4
Date: Wed, 25 Aug 2004 08:52:00 +0200
From: Axel M?ller <axel.mueller at amit-services.de>
Subject: Re: [ZPT] Re: PageTemplateFile
To: Chris Withers <cwithers at gmail.com>
Cc: zpt at zope.org
Message-ID: <200408250852.00992.axel.mueller at amit-services.de>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch, 25. August 2004 08:24 schrieb Chris Withers:
> Axel Müller wrote:
> > This wouldn't work for me, because every root-folder would have the same
> > "standardHeader":
> > -----------
> > class A:
> > standardHeader = PageTemplateFile('Pfad/zu/standardHeader',globals())
> > -----------
> > It is making "standardHeader" a PageTemplateFile object as an
> > class-attribute of A.
>
> Woah, you need to go read about metal macros before trying anything
else...
ZPTReference on zope.org. But that's not the point here, as far as I can
see.
What is wrong with the above sentences (beside my english and a missing
closing brace)?
axel
--
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
fax (06322) 680 666
mobil 0160 973 483 27
------------------------------
Message: 5
Date: Wed, 25 Aug 2004 09:03:27 +0200
From: Axel M?ller <axel.mueller at amit-services.de>
Subject: Re: [ZPT] PageTemplateFile again. Why Antipersistent??
To: Chris Withers <cwithers at gmail.com>
Cc: zpt at zope.org
Message-ID: <200408250903.27802.axel.mueller at amit-services.de>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch, 25. August 2004 08:26 schrieb Chris Withers:
> > HtmlFile, ImageFile etc. can be added to instances in ZODB:
> >
> > setattr(self,'name',HTMLFile('asdfad',globals()))
> >
> > (replace HTMLFile as needed)
>
> ...but REALLY shouldn't. Seriously, that's not what they're designed for.
shure, but what's the problem with it? I implemented skins as folders
outside
the ZODB. I need skins not as skins for the visitor of the side to change
from blue to red, but to have different skins per folder in one instance of
Zope.
> What you really want is to instantiate a normal PageTemplate object, set
> it as the attribute of your class instance, and then call it's edit
> method with the data you read off the filesystem.
that is exactly what I tried to omit. Because my folders should only contain
the data they are made for. I'm trying to separate the data from the ui.
axel
--
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
fax (06322) 680 666
mobil 0160 973 483 27
------------------------------
Message: 6
Date: Wed, 25 Aug 2004 08:10:02 +0100
From: Chris Withers <cwithers at gmail.com>
Subject: Re: [ZPT] PageTemplateFile again. Why Antipersistent??
To: "Axel Müller" <axel.mueller at amit-services.de>
Cc: zpt at zope.org
Message-ID: <a47ae2ce04082500101411aae6 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Wed, 25 Aug 2004 09:03:27 +0200, Axel Müller
<axel.mueller at amit-services.de> wrote:
> > ...but REALLY shouldn't. Seriously, that's not what they're designed
for.
> shure, but what's the problem with it? I implemented skins as folders
outside
> the ZODB. I need skins not as skins for the visitor of the side to change
> from blue to red, but to have different skins per folder in one instance
of
> Zope.
If that's the case then have them as class attributes. You'll need
some other way to support your usecase though...
> that is exactly what I tried to omit. Because my folders should only
contain
> the data they are made for. I'm trying to separate the data from the ui.
Look at CMF, or Zope 3 then...
Chris
--
Simplistix
- Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
------------------------------
Message: 7
Date: Wed, 25 Aug 2004 08:11:11 +0100
From: Chris Withers <cwithers at gmail.com>
Subject: Re: [ZPT] Re: PageTemplateFile
To: "Axel Müller" <axel.mueller at amit-services.de>
Cc: zpt at zope.org
Message-ID: <a47ae2ce0408250011beb71e0 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
You don't do headers and footers with ZPT, you do a page macro with some
slots.
On Wed, 25 Aug 2004 08:52:00 +0200, Axel Müller
<axel.mueller at amit-services.de> wrote:
> Am Mittwoch, 25. August 2004 08:24 schrieb Chris Withers:
> > Axel Müller wrote:
> > > This wouldn't work for me, because every root-folder would have the
same
> > > "standardHeader":
> > > -----------
> > > class A:
> > > standardHeader = PageTemplateFile('Pfad/zu/standardHeader',globals())
> > > -----------
> > > It is making "standardHeader" a PageTemplateFile object as an
> > > class-attribute of A.
> >
> > Woah, you need to go read about metal macros before trying anything
else...
>
> ZPTReference on zope.org. But that's not the point here, as far as I can
see.
> What is wrong with the above sentences (beside my english and a missing
> closing brace)?
> axel
>
> --
> axel.mueller at amit-services.de
> http://www.amit-services.de
> tel (06322) 680 668
> fax (06322) 680 666
> mobil 0160 973 483 27
>
--
--
Simplistix
- Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
------------------------------
Message: 8
Date: Wed, 25 Aug 2004 09:28:26 +0200
From: Axel M?ller <axel.mueller at amit-services.de>
Subject: Re: [ZPT] PageTemplateFile again. Why Antipersistent??
To: chris at simplistix.co.uk
Cc: zpt at zope.org
Message-ID: <200408250928.26562.axel.mueller at amit-services.de>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch, 25. August 2004 09:10 schrieb Chris Withers:
> If that's the case then have them as class attributes. You'll need
> some other way to support your usecase though...
so there is no "intended" or not dangerous way to change the path for
instances?
xyz = PageTemplateFile('sad'+dynamic_part+'asf',globals())
>
> > that is exactly what I tried to omit. Because my folders should only
> > contain the data they are made for. I'm trying to separate the data from
> > the ui.
>
> Look at CMF, or Zope 3 then...
I'll look at Zope 3, but thats future, isn't it?
thanks for your patience,
axel
--
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
fax (06322) 680 666
mobil 0160 973 483 27
------------------------------
Message: 9
Date: Wed, 25 Aug 2004 09:42:46 +0200
From: Axel M?ller <axel.mueller at amit-services.de>
Subject: Re: [ZPT] Re: PageTemplateFile
To: zpt at zope.org
Message-ID: <200408250942.46122.axel.mueller at amit-services.de>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch, 25. August 2004 09:11 schrieb Chris Withers:
> You don't do headers and footers with ZPT, you do a page macro with some
> slots.
Ok, my fault. standardHeader is just a name for historical reasons. Of
course
it uses macros and slots. Sorry.
axel
--
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
fax (06322) 680 666
mobil 0160 973 483 27
------------------------------
Message: 10
Date: Wed, 25 Aug 2004 10:56:52 +0200
From: "gustav" <gustav at ifrance.com>
Subject: [ZPT] probleme with condition
To: <zpt at zope.org>
Message-ID: <NEBBIMHFMKLKDBGNGLIAGEKOCIAA.gustav at ifrance.com>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
I have a table with different columns (= numbers) coming from a mysql
db.
When the content of this columns meet a condition, I want to change the
color.
<td align="center"
tal:content="python:container.s_division(var_period, info_count)"
tal:condition="python:not container.s_compare(var_ouvre,
container.s_division(var_period, info_count))"
style="color=red"> </td>
<td align="center"
tal:content="python:container.s_division(var_period, info_count)"
tal:condition="python:container.s_compare(var_ouvre,
container.s_division(var_period, info_count))"
style="color:green"> </td>
the script s_compare :
import string
print int(round(10*(int(numint) - float(str)))) == 0
return printed
The problem : the test is not working, its allways green.
But if I add a cell with the comparing thing as content
<td tal:content="python:container.s_compare(var_ouvre,
container.s_division(var_period, info_count))"> </td>
I can see that the comparaison is ok - i get true or false
What's wrong ?
_______________________________________________________________
my music http://hurpasard.free.fr
my paintings http://peinturesurlenet.free.fr
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 24/08/2004
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
------------------------------
Message: 11
Date: Wed, 25 Aug 2004 11:26:17 +0200
From: Axel M?ller <axel.mueller at amit-services.de>
Subject: Re: [ZPT] probleme with condition
To: zpt at zope.org
Cc: gustav <gustav at ifrance.com>
Message-ID: <200408251126.17236.axel.mueller at amit-services.de>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch, 25. August 2004 10:56 schrieb gustav:
> Hello,
>
> I have a table with different columns (= numbers) coming from a mysql
> db.
> When the content of this columns meet a condition, I want to change the
> color.
>
> <td align="center"
> tal:content="python:container.s_division(var_period, info_count)"
> tal:condition="python:not container.s_compare(var_ouvre,
> container.s_division(var_period, info_count))"
> style="color=red"> </td>
> <td align="center"
> tal:content="python:container.s_division(var_period, info_count)"
> tal:condition="python:container.s_compare(var_ouvre,
> container.s_division(var_period, info_count))"
> style="color:green"> </td>
>
> the script s_compare :
> import string
> print int(round(10*(int(numint) - float(str)))) == 0
> return printed
>
> The problem : the test is not working, its allways green.
>
> But if I add a cell with the comparing thing as content
> <td tal:content="python:container.s_compare(var_ouvre,
> container.s_division(var_period, info_count))"> </td>
>
> I can see that the comparaison is ok - i get true or false
>
> What's wrong ?
is it ok, that printed returns a string, not a bool?
maybe you should return the bool:
the script s_compare :
import string
mybool = int(round(10*(int(numint) - float(str)))) == 0
return mybool
axel
--
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
fax (06322) 680 666
mobil 0160 973 483 27
------------------------------
Message: 12
Date: Wed, 25 Aug 2004 10:33:57 -0500
From: Jeff Peterson <jpeterso at rangebroadband.com>
Subject: Re: [ZPT] probleme with condition
To: gustav <gustav at ifrance.com>
Cc: zpt at zope.org
Message-ID: <412CB165.10402 at rangebroadband.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
gustav wrote:
>Hello,
>
>I have a table with different columns (= numbers) coming from a mysql
>db.
>When the content of this columns meet a condition, I want to change the
>color.
>
><td align="center"
> tal:content="python:container.s_division(var_period, info_count)"
> tal:condition="python:not container.s_compare(var_ouvre,
>container.s_division(var_period, info_count))"
> style="color=red"> </td>
><td align="center"
> tal:content="python:container.s_division(var_period, info_count)"
> tal:condition="python:container.s_compare(var_ouvre,
>container.s_division(var_period, info_count))"
> style="color:green"> </td>
>
>the script s_compare :
>import string
>print int(round(10*(int(numint) - float(str)))) == 0
>return printed
>
>
try this:
return int(round(10*(int(numint) - float(str)))) == 0
>The problem : the test is not working, its allways green.
>
>But if I add a cell with the comparing thing as content
><td tal:content="python:container.s_compare(var_ouvre,
>container.s_division(var_period, info_count))"> </td>
>
>I can see that the comparaison is ok - i get true or false
>
>What's wrong ?
>_______________________________________________________________
>my music http://hurpasard.free.fr
>my paintings http://peinturesurlenet.free.fr
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.744 / Virus Database: 496 - Release Date: 24/08/2004
>
>
>_____________________________________________________________________
>Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
>http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
>
>_______________________________________________
>ZPT mailing list
>ZPT at zope.org
>http://mail.zope.org/mailman/listinfo/zpt
>
>
>
------------------------------
_______________________________________________
ZPT mailing list
ZPT at zope.org
http://mail.zope.org/mailman/listinfo/zpt
End of ZPT Digest, Vol 17, Issue 21
***********************************
More information about the ZPT
mailing list