Tuesday, October 29, 2013

Keyword arguments passed to ListView.as_view() in urlconf ignored, django 1.5.4

code segment 1:

url(r'^some_url$', SomeTemplateView.as_view(), {'tab': 'index'}),

the 'tab' variable can be fetched in the template
while in

code segment 2:

url(r'^some_url$', SomeListView.as_view(), {'tab': 'index'}),

the 'tab' variable is missing in the template.

I found that in Lib\site-packages\django\views\generic\list.py
in line 139         context = self.get_context_data(object_list=self.object_list)
the **kwargs are not passed to self.get_context_data

Could this be regarded as a bug of django 1.5.4?

Appreciate any responses!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e8617db9-1ff2-4b4c-9afe-21ae13334363%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment