I've the following URL that i created:
urls.py
url(r'^authors', GenericView.as_view(model=Author, context_object_name='authors_list',
success_url=reverse_lazy('author_link'),
template_name='app/authors.html'), name='author_url_name'),
And i want to have access to the URL's name on the view, passed in a variable. In this case, 'author_url_name'.
The view function where i need it, is the following:
views.py
def get_context_data(self, **kwargs):
context = super(AuthorClass, self).get_context_data(**kwargs)
context['action'] = reverse_lazy('author_url_name')
return context
This works, but i want to replace the 'author_url_name' for some method that gives me exactly that.
Thanks for your time!!