Opened 7 years ago

Last modified 7 years ago

#28587 closed Bug

All Generic Views are loosing args when you pass args and kwargs into urlpattern — at Version 2

Reported by: Adrian Owned by: nobody
Component: Generic views Version: 1.11
Severity: Normal Keywords: ListView, CBV, generic,
Cc: Adrian Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian)

When I have in my urlpatterns args and kwargs the ListView is loosing args (it's returning empty tuple)

url(r"^(\w+)/test1/(?P<pk>[0-9]+)/list/$", SamplesListView.as_view(), name='list_view'),

Simple code for my view:

class SamplesListView(ListView):
    model = Sample
    template_name = 'samples/samples_list.html'

    def get(self, request, project_name, *args, **kwargs):
        print("project_name", project_name)
        return super().get(self, request, project_name, *args, **kwargs)

It works ok when I pass only args or kwargs into url.

THE PROBLEM occurs in ALL generic view (CreateView, UpdateView, DeleteVIew, ListView)

Change History (2)

comment:1 by Adrian, 7 years ago

Summary: ListView cleaning arListView cleaning args when you pass args and kwargs into urlpattern

comment:2 by Adrian, 7 years ago

Cc: Adrian added
Description: modified (diff)
Summary: ListView cleaning args when you pass args and kwargs into urlpatternAll Generic Views are loosing args when you pass args and kwargs into urlpattern
Note: See TracTickets for help on using tickets.
Back to Top