[Zope] prefix attribute in dtml-in

2006-06-08 Thread Sam Boggess
Using Zope 2.8, I have two nested dtml-in tags that each loop  
through the results of different SQL methods.  I'm trying to use the  
prefix attribute to differentiate the two, but I can't get it to  
work.  Does anyone have any thoughts?


dtml-in expr=getConsulting() prefix=topic
  fieldset
  legenddtml-var expr=sequence_var_fulltitle Sub Topics/legend
dtml-in expr=getConsultingSub() prefix=subtopic
fieldset
legendTopic dtml-var subtopic_displayorder: dtml-var  
subtopic_menutitle/legend

/fieldset
  /dtml-in
  /fieldset
/dtml-in
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] standard_error_message in ZPT

2005-12-27 Thread Sam Boggess
Does anyone know if it possible to rewrite the standard_error_message  
in Page Templates?

And if so how do you reference the objects within the error message?

p tal:content=here/error_valueerror value/p

doesn't work.

Thanks.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Translating a webpage

2005-12-05 Thread Sam Boggess
I'm wondering if someone can point me in the direction of some  
documentation that will tell me the best way to translate a web page  
into multiple languages using Zope Page Templates.  In previous sites  
we've done in DTML we used a 'phrases' table in our MySQL database  
that contained phrases in each language the site required.   We then  
used sql methods and a dtml-let statement to create a list of the  
phrases used on a certain page.  I'm considering using the same basic  
idea for a page template site, but am wondering if there is a better  
way of doing translations.  I've read about using .po files.  Is  
there an easy way to hook these up to Zope? Any help would be greatly  
appreciated.


Thanks.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Random Module

2005-08-26 Thread Sam Boggess
My bad, Zope does allow the random module, was just importing and 
refering to it wrong in my script:


#Bad:
from random import *
randomNum = random()

#Good:
import random
randomNum = random.random()


Thanks for all you help.


Aaron Bauman wrote:


From ZopeBook 2.6:

quote
Using a module usage (pick a random choice from a list):

span tal:replace=python:modules['random'].choice(['one',
'two', 'three', 'four', 'five'])
a random number between one and five
/span
/quote

Substitute any list you wish...

to generate a random number [ 0  x  1 ), you'd just use something like
quote
tal:define define=random_floating_point_number
python:modules['random'].random() /
/quote

I'd be curious to know if the random() method DOESN't work, 
cause the choice method has definitely worked for me...


Hope it helps,
-
Aaron Bauman
http://www.gaycenter.org



-Original Message-
From: David Siedband [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 2:38 PM

To: ZOPE.org
Subject: Re: [Zope] Random Module

Are you sure you can't import the functions you need?  It might be
worthwhile to see if what you want to do can be done without adding to your
allowed modules.  That should be kind of a last resort.  I'm curious what
kind of functionality you need from random that can't be done within the
importable functions...
--
David


On Aug 25, 2005, at 10:36 AM, Sam Boggess wrote:

 

Why won't Zope let me call the random module?  It's really annoying to 
have to write an external method to call such a simple tool.  Is there 
a way around this?  Thanks.
   






 



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Random Module

2005-08-25 Thread Sam Boggess
Why won't Zope let me call the random module?  It's really annoying to 
have to write an external method to call such a simple tool.  Is there a 
way around this?  Thanks.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )