On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote:
> (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?

You're using a variable "feedtype" that's not defined.

It's the same thing as doing this in the Python interactive prompt:

    print a + 1

The variable "a" is not defined yet, so Python raises a NameError.

The problem in your case is that your view won't know the value of
feedtype until the URL is parsed. For that reason, you cannot put that
logic in the URLconf.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

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

Reply via email to