On Feb 10, 3:17 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Mon, 2009-02-09 at 07:29 -0800, Emily Rodgers wrote:
> > Hi,
>
> > I have written a django app that manages 'change requests' (and
> > approvals) for IT infrastructure changes in our company, and I am
> > using theurlizefilter when displaying certain fields (like
> > description of change, test plan etc). This is so that if a user puts
> > a link to documentation for a system / change then it shows up as a
> > link.
>
> > This works reasonably well - in fact too well in some cases. As you
> > can imagine some of the descriptions contain lists of domains, and
> > these are all getting changed to links. I have logged a feature
> > request for my next release of my app to sort the problem out
> > (probably by wrapping lists of domain's in <verbatim> tags, then
> > writing a custom filter tourlizestuff that is not surrounded by
> > these tags), but I was wondering if this might be something that other
> > django users would want, and if so, is it worth me raising a feature
> > request to get the functionality put in to the djangourlizefilter?
>
> Theurlizetag is designed to "urlize" anything that looks likely to be
> a link. That includes domains, since they can be valid links. If it
> doesn't work for your purposes, don't use it.
>
>
>
> > Or perhaps someone has a better suggestion for how to get around this
> > problem?
>
> Writing custom template tags is (by design) very easy. If any existing
> tag doesn't do what you're after, or you have some other use-case that
> requires special handling, then write the Python code to handle it.
>
> It's pretty much intentional that Django doesn't handle every situation
> out of the box. The universe of possibilities is too large (your example
> is a case in point: you want to exclude some things that are normally
> perfectly valid to be treated as URLs). Instead, we provide a lot of
> ways for people to build their own extensions.

Thanks for your help. I suspected that I would have to do this, but I
thought it would be a good idea to put it out there in case there was
a better way.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to