Hello everyone,

Here is my urls.py:

from django.conf.urls.defaults import *
from django.views.generic import list_detail
from rdk.staff.models import *

groups = {
          'queryset' :
Group.objects.all().select_related().order_by('name'),
          'template_name' : 'staff.html',
}

employee = {
            'queryset' : Employee.objects.all(),
            'template_name' : 'employee.html',
            'slug' : 'slug', #  <-- not sure this is correct?
            'slug_field' : 'slug'
}

urlpatterns = patterns('staff',
    (r'^/$', list_detail.object_list, groups),
    (r'^(?P<slug>[-\w]+)/$', list_detail.object_detail, employee),
)

Is this syntax correct? I keep getting a 404 when I try to view the
detail for an Employee. I have a slug field on the Employee, and am
constructing the link using get_absolute_url and the URL sytnax is
correct, emitting: /staff/my-slug/.

I'm still pretty new to Django, so I hope this is an appropriate use
for the generic views, I'm just a little confused on the syntax.

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