I have a view
class FooDetailView(View):
def get(request, *args):
foo_id = int(args[0])
foo = Foo.objects.get(pk=foo_id)
// do something and render the page
And now I would like to add some message into this page. For example
class FooFuncView(View):
def get(request):
// do something
return redirect('foo-detail', foo_id, 'call Func successfully')
Since my urls.py is simply
url(r'^foo-detail/([1-9][0-9]*)/', FooDetailView.as_view(),
name='foo-detail'),
I get the error message becuase no reverse match
Reverse for 'foo-detail' with arguments '(<id>, 'call Func successfully')' not found. 1 pattern(s) tried: ['tournament-detail/contestant/([1-9][0-9]*)/']
But I dont want the message shown in the url because it could be too long. I just want to simply render the page as FooDetailView does, and add extra message after different operation. It there any good way to achieve this? If not, any explantions for that?