Re: You asked for it, you got it (comment previews)

Bill Mill <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
> Nice one!
> 
> Works like a charm here.
> I changed the following in build_preview_comment to make the URL optional:
> 
> c['cmt_link'] = (form.has_key('url') and [form['url'].value] or [''])[0]

Steven,

thanks, and I'm glad that it works for you.

To make the url optional, it's better just to move it entirely out of
the try clause, and do it just like the email value is done, i.e.:

if form.has_key('url'): 
    c['cmt_link'] = form['url'].value

I just think that's a bit neater than the way you did it, but both
should be functional.

Peace
Bill Mill
bill.mill at gmail.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.