I think you can write it like
(r‘^([\w-]+)/(\d{4})/(\d+)/(\d+)/(?P<id>\d+)/$’,
find_seminar_occurrence),
it should be OK.

On 4月20日, 上午10时31分, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Changing my urls.py to this:
>
> from django.conf.urls.defaults import *
> from rdk.training.views import *
>
> urlpatterns = patterns('',
>                        (r'^$', list_seminars),
>                        (r'^([\w-]+)/(\d{4})/(\d{1,2})/(\d{1,2})/(?P<id>
> \d+)/$', find_seminar_occurrence),
> )
>
> fixed the problem. I simply added a caret to the beginning of the
> second pattern. Hope this helps someone else.
>
> Brandon
>
> On Apr 19, 8:24 am, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
>
> > In my urls.py, I'm matching: a slug from a foreign key / the year /
> > month / day / pk of the record as such:
>
> > from django.conf.urls.defaults import *
> > from rdk.training.views import *
>
> > urlpatterns = patterns('',
> >                        (r'^$', list_seminars),
> >                        (r'[-\w]+/d{4}/d+/d+/(?P<id>d+)/$',
> > find_seminar_occurrence),
> > )
>
> > #In views.py
>
> > def find_seminar_occurrence(request, id):
> >     seminars = Seminar.objects.exclude(pk=id).order_by('title')
> >     occurrence = Occurrence.objects.get(pk=id)
> >     return render_to_response('seminar_detail.html', locals())
>
> > The problem is that the template that Django is looking for is the
> > primary key + .html: 3.html, 1.html, etc. What did I do wrong?
>
> > TIA,
> > Brandon
--~--~---------~--~----~------------~-------~--~----~
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