On Fri, Jun 10, 2011 at 5:55 AM, javatina <serge.i...@gmail.com> wrote:

>
> ===== in views.py: =======
> see formatted http://dpaste.com/hold/552703/
>
> same as:
>
> def test(request, slug=None):
>    slugs = Concept.objects.filter(status__slug = 'active').order_by('-
> published_on').values_list('slug', flat=True)
>    try:
>        concept = Concept.objects.get(slug = slug, status__slug =
> 'active')
>    except Page.DoesNotExist:
>        raise Http404
>
>    slugs_list = list(slugs)      # ======> problem line
>
>
>

> =====  traceback =========
> http://dpaste.com/552702/
>

 According to your traceback, when you call list(slugs), on line 446, it is
not using the python list() built-in, but calling what appears to be a list
function that you have defined earlier (around line 400)

My initial guess would be that you have something like this above the code
you have pasted:

def list(request):
    ...
    context_instance=RequestContext(request)
    ...

And that call is throwing an exception, because you are passing a QuerySet
into RequestContext(), which is expecting an HttpRequest, and its
accompanying META attribute.

Check to see if that's the case, and rename your list() view if it is.

-- 
Regards,
Ian Clelland
<clell...@gmail.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 
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