See https://gist.github.com/1356199/bd1af5e81d51ef32a3f4aa29a7a9120c9a8ffe85

The problem is that you're overriding get_queryset when you should be
overriding get_object

2011/11/10 Micky Hulse <rgmi...@gmail.com>

> Hello,
>
> I am in the process of upgrading this "old" functional code:
>
> urls_old.py:
> <https://gist.github.com/1356108#file_urls_old.py>
>
> views_old.py:
> <https://gist.github.com/1356108#file_views_old.py>
>
> Here's what I have so far:
>
> urls.py:
> <https://gist.github.com/1356108#file_urls.py>
>
> views.py:
> <https://gist.github.com/1356108#file_views.py>
>
> ---------
>
> I just have a few questions:
>
> 1.
>
> How can I access kwargs from the URL?
>
> When I try self.kwargs['username'] I get this error:
>
> "Generic detail view UserDetail must be called with either an object
> pk or a slug."
>
> 2.
>
> All I want to do is pass "user" and "profile" to my template...
> Looking at my class-based view/url, am I going about this right (other
> than the error)?
>
> As it stands now, my "new" code seems kinda convoluted; having to say
> "self.profile" and then call get_context_data just to pass "profile"
> seems like a lot of extra work when compared to the older
> function-based view.
>
> ---------
>
> Any tips ya'll could provide would be extremely helpful! :)
>
> Thanks in advance!
>
> Cheers,
> M
>
> --
> 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.
>
>


-- 
Andrés Reyes Monge
armo...@gmail.com
+(505)-8873-7217

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