You are absolutely correct. I certainly need to improve my Python
skills, think more Python and get rid of some old habits. Another
lesson - I could easily find the problem myself if I trusted more
myself instead of sending tracebacks asking for help. So, I guess
double thanks are in order.

Serge

On Jun 10, 11:29 am, Ian Clelland <clell...@gmail.com> wrote:
> On Fri, Jun 10, 2011 at 5:55 AM, javatina <serge.i...@gmail.com> wrote:
>
> > ===== in views.py: =======
> > see formattedhttp://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