On 12/22/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> On Wed, 2007-12-19 at 08:15 -0800, Trochalakis Christos wrote:
> > Hello there,
> >
> > I'm trying to use the "url" template function but i cant make it work.
> >
> > My attempt:
> >
> > urls.py:
> >
> > urlpatterns = patterns('',
> >     url(r'^tag/(?P<tag>[^/]+(?u))/$',
> >         tagged_object_list,
> >         dict(model=Entry, paginate_by=10, allow_empty=True,
> >             template_object_name='entry'),
> >         name="tag_index"),
> > )
> >
> > my template:
> >
> > {% url tag_index tag=django %}
> >
> > Django version: 0.97-pre-SVN-6920
> > Exception:
> >
> > Request Method:       GET
> > Request URL:  http://localhost:8080/
> > Exception Type:       error
> > Exception Value:      unknown extension
> [...]
> In this case, though, you're lucky; I recognise the error. The
> reverse-parsing of the reg-exps in URL patterns doesn't handle every
> possible feature of Python's reg-exp engine. You're using smoething it
> doesn't handle (quite probably the (?u) flag). Fortunately, you can just
> drop the "?u" bit, since all URL patterns are matched with the
> re.UNICODE flag enabled.

Works like a charm now! Thanks Malcom.

I got the regex from the tagging app documentation, so I also filled a
bug there.

http://code.google.com/p/django-tagging/issues/detail?id=82

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to