Step 9 (S-53861)

From Stepik Wiki
Revision as of 16:53, 12 March 2017 by Admin (Talk | contribs) (Create page for step id=53861)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Step on Stepik: https://stepik.org/lesson/14828/step/9

Допустим в urls.py есть следующий маршрут


url(r'article/(?P<id>\d+)/?', article)



Какой из нижеприведенных view правильно получает захваченную переменную ?

A)


def article(request, id):
    ...


B)


def article(request, *args):
    id = args[0]
    ...


C)


def article(request, **kwargs):
    id = kwargs[0]
    ...


D)


def article(request):
    id = request.ARGS['id']
    ...