Rob B (uk) wrote:
> Solved it by doing this:
> 
> def profile_detail(request, name):
>     p = get_object_or_404(Profile, name=name)
>     return render_to_response('profile_detail.html', {'name': p})

How about using the detail generic view:

from django.views.generic.list_detail import object_detail

urlpatterns = patterns('',
  (r'^(?P<name>[\w\._-]+)/$',
   object_detail,
   {'queryset':Profile.objects.all()}))

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

--~--~---------~--~----~------------~-------~--~----~
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