1👍
✅
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
…
The proper way of solving this is passing an extra option to the view. See related documentation entry.
Example:
url('^college/$', 'tag_view', {'model': College})
def tag_view(request, model):
records = model.objects.filter(…)
Furthermore, actions should not be included in URL’s name. URLs should identify resources. Therefore I would skip the browse
part of the URL.
Source:stackexchange.com