Jul-06-2020, 07:45 AM
(This post was last modified: Jul-06-2020, 07:45 AM by card51shor.)
My issue right now is getting the view to complete both the rendering of the function that edits the entry but then also redirect the user back to the wiki/<title> webpage. I can't figure out how to make it return those 2 things. I want it to save the entry first, then go back to the original page that was edited. How can i do that?
Here is my code in question:
I can change the encyclopaedia/save.html to encyclopedia/wiki/<title> but then it gives me an error that save is not a valid page. What's the best way to make sure it runs the save.html briefly (that says "record save") then reloads back to the original page? Thanks!
Here is my code in question:
def save(request): title = request.POST.get("title") content = request.POST.get("content") return render(request, "encyclopedia/save.html", { "entries": util.save_entry(title, content) })how is it possible that I can make it return the save_entry function but also return back to the original page? What is the syntax for including two things?
I can change the encyclopaedia/save.html to encyclopedia/wiki/<title> but then it gives me an error that save is not a valid page. What's the best way to make sure it runs the save.html briefly (that says "record save") then reloads back to the original page? Thanks!