Answer the question
In order to leave comments, you need to log in
How to write in url.py correctly?
There are two functions. Both have a slug field, how do I get them both processed in url.py? Such an option as I have now processes only the top line. I understand why this happens, but here's how to make both functions work. They need to be without url like arenda/(?P[-\w]+)/$/.
url(r'^(?P<slug>[-\w]+)/$', Arenda.as_view()),
url(r'^(?P<slug>[-\w]+)/$', Sale.as_view()),
Answer the question
In order to leave comments, you need to log in
Hang on different urls.
url(r'^rent/(?P<slug>[-\w]+)/$', Arenda.as_view()),
url(r'^sale/(?P<slug>[-\w]+)/$', Sale.as_view()),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question