On 1/13/08, huntercross <[EMAIL PROTECTED]> wrote:
>
>
> Yes, I thought that might work reviousy and tried that, but it
> resulted in an Internal Server Error 500. I get a lot of these
> with various python syntax errors, such as leaving out parentheses and
> having an '=' instead of a '==' in an if statement. Moving the
> web.template.template code ahead of the render code gives me the 500
> error as well.so thats no good.
>
i'm guessing there is somethign syntactically wrong with it...
> i'm running apache with mod_wsgi and web.py 2.2
can you send traceback of your error, so that it will be more clear where
you are getting the error.
On Jan 11, 11:42pm, "ashok raavi" <[EMAIL PROTECTED]> wrote:
> > On 1/12/08, huntercross <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > i searched the documentation and the group, but couldn't find an
> > > answer. hopefully it is an easy one.
> > > i want to implement a function called nice_telephone() in my templates
> > > that formats
> > > telephone numbers pulled from the database.
> >
> > > here is my code.py...
> >
> > > render = web.template.render('/removed/httpd/htdocs/templates/',
> > > cache=False)
> > > web.template.Template.globals['nice_telephone'] = nice_telephone
> >
> > > then the the function is below that a ways...
> >
> > rearrange your code.
> >
> > move the function definition to be above the template globals.
> >
> > looks like this is the only problem.
> >
> > def nice_telephone(t):
> >
> >
> >
> > > st = str(t)
> >
> > > ret = st[0:2] + '-' + st[3:5] + '-' + st[6-8]
> >
> > > print ret
> >
> > > then in the template file we have:
> >
> > > <span class="edit" id="resume_telephone">
> > > $:nice_telephone(resume.resume_telephone)</span>
> >
> > > the error i get is:
> > > <type 'exceptions.NameError'> at /admin/edit/46
> > > could not find 'nice_telephone' (line 28)
> >
> > > what am i messing up? thank yo ufor all your help, i love web.py!
> >
> > --
> > ashok raavi
> >
>
--
ashok raavi
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---