YES, IT DID HELP!!!
I didnt notice this suggestion until tonight. thank you so much. The
function must be declared BEFORE it is added to the global template-
accessible functions.
So it goes:
1. Function to be globalized
2. web.template....
3. render = web.template...
Wonderful! thank you so much. here is the code now:
def nice_telephone(t, sep = '-'):
""" outputs a nice looking telephone
number from a 10 digit int passed as t.
allows you to customize default seperator """
st = str(t)
ret = st[0:3] + sep + st[3:6] + sep + st[6:10]
return ret
# make nice_telephone() accessible to edit page
web.template.Template.globals['nice_telephone'] = nice_telephone
# setup render directory using full server path
render = web.template.render('/removed/httpd/htdocs/templates/',
cache=False)
then in the template file we have:
<span class="edit" id="resume_telephone">
$:nice_telephone(resume.resume_telephone)</span>
i will write this up in the documentation as proper form.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---