Tuesday, October 29, 2013

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

Thank you for your reply, Tim.

This behavior confuses new users of CBVs. It takes time to learn it.


On Tue, Oct 29, 2013 at 10:30 PM, tim <timograham@gmail.com> wrote:
I don't think so. There is actually a ticket to discontinue this behavior on the CBVs that do it: https://code.djangoproject.com/ticket/19878

On Tuesday, October 29, 2013 9:51:06 AM UTC-4, Chang Sun wrote:
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 a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/kC46bU-R-6k/unsubscribe.
To unsubscribe from this group and all its topics, 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/edb4b990-9e67-409b-8252-9d606d48120c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/CAFEq18GXFGkPA-mj-8FNaBJQoF1SF%2B_qN7-%2BX0u2Ki7ce7DO6A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment