Answer the question
In order to leave comments, you need to log in
How to nest menu items of arbitrary depth?
How to make url pattern for menu of arbitrary view depth:
1) ааа
1.1) ббб
1.2) ббб
1.2.1) ввв
2) ггг
2.1) ддд
Answer the question
In order to leave comments, you need to log in
This is a very bad decision, it is better not to try to use variable length arguments in views, but anything is possible.
urlpatterns = [
url(r'^((\d+(\.\d+)*/)+)$', varargs),
]
def varargs(request, path, *args):
path_list = [i for i in path.split('/') if i]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question