Monday, November 29, 2010

Slug for some terms not working

I am completely at a loss here and have no idea what the problem is:

A slug was created for the term escape. So website.com/projects/
escape/

url patterns:
url(r'^projects/(?P<slug>[-\w]+)/$', 'views.projectslug',
name='view_project_slug'),

view:
def projectslug(request, slug):
"""Displays the selected project"""
project = get_object_or_404(Project, slug=slug)

if request.user.is_authenticated() and
project.team.members.filter(user=request.user):
is_member = True
else:
is_member = False

return render_to_response('projects/project.html', {
'selecteduser': project.user,
'project': project,
'is_member': is_member,
'latest_blog': project.blogs.all().order_by('-id')[:1],
'latest_videos': project.videos.all().order_by('-id')[:6],
'latest_galleries': project.photos.all().order_by('-id')[:
6],
'active_members': project.team.members.all().order_by('-
user__last_login')[:6],
'forum': project.forum
},
context_instance=RequestContext(request))

Now for some reason when trying to use the slug escape I am taken to a
page does not exists page. This has happened with a few other terms.
When I change the slug to escape-something it works without a problem.

What am I missing?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment