Anton Daneika wrote: > Hello, everyone. > > I am trying to call django.views.generic.list_detail.object_list from my > own view, but I get the error page saying "dict' object has no attribute > '_clone'" > > Here is the function: > def my_gallery_listing(request, gallery_id): > d = dict(queryset=Photo.objects.filter(gallery__pk = gallery_id), > paginate_by= 2, allow_empty= True) > django.views.generic.list_detail.object_list(request, d)
The info_dict that you usually construct in urlconf is not intended to be passed to a generic view "as is". It has to be converted into keyword arguments which in Python is done with '**': return django.views.generic.list_detail.object_list(request, **d) This is equivalent to: return django.views.generic.list_detail.object_list(request, queryset=Photo.objects.filter(...), paginate_by=..., allow_empty=....) When you pass it without converting as a single argument `object_list` thinks that `d` is its first parameter where it expects a queryset and calls `_clone` on it. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---