Hi Jon, On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: [snip] > I've just tried removing the regular expression - so the line looks like: > > (r'^/?(?P<feedtype>\w+)/$', > 'django.views.generic.list_detail.object_list', {'queryset': > Item.objects.filter(feed__feedtype__feedtype__iexact=feedtype).order_by('-time'), > 'paginate_by': 15, 'extra_context': {'is_first_page': True}}), > > And oddly enough I'm getting exactly the same error; is there another > problem with this statement which I'm not seeing? It seems there is a > problem with variable from the url expression being passed to the view > function - is this a common problem?
I think you've just identified the problem! Unfortunately, this means that you're going to need a custom view for this object list. What's lacking in the generic object list is a "slugfield" similar to what's found in generic object detail. If that existed, you'd be able to do something like this: (r'^/?(?P<filter>\w+)/$', 'django.views.generic.list_detail.object_list', {'queryset': Item.objects.all().order_by('-time'), 'filter_field':'feed__feedtype__feedtype__iexact', 'paginate_by': 15 }), Django would then substitute the captured "filter" variable into the query-set like this: Item.objects.all().order_by('-time').filter( feed__feedtype__feedtype__iexact = captured_value ) I think it's worth raising a feature request in the Django Trac for this functionality. I can imagine that this would be very useful to a lot of people in the future. Michael --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---