Jul-07-2020, 03:20 AM
(This post was last modified: Jul-07-2020, 03:41 AM by card51shor.)
I thought that was the syntax of all views? Why does it matter if I pass it or not? I'm not using it on save.html.
So I shouldn't call render? Why not? What should I do instead?
would i just use "return util.save_entry(title, content)"? What page should it load?
the original page where I did the editing was wiki/<title> How can I get the title on the save page because I need to use that title to go back to the original page. How else can I get the title variable?
OK I used your advice and figured it out. I changed it to:
OK I'm on the final step! Now I have to change the markup to HTML when shown to the user. I'm going to fiddle around with this later tonight. Any tips as I do it?
Thanks
So I shouldn't call render? Why not? What should I do instead?
would i just use "return util.save_entry(title, content)"? What page should it load?
the original page where I did the editing was wiki/<title> How can I get the title on the save page because I need to use that title to go back to the original page. How else can I get the title variable?
OK I used your advice and figured it out. I changed it to:
def save(request): title = request.POST.get("title") content = request.POST.get("content") util.save_entry(title, content) return render(request, "encyclopedia/wiki.html", { "entries": util.get_entry(title) })Probably not the most efficient but it works!
OK I'm on the final step! Now I have to change the markup to HTML when shown to the user. I'm going to fiddle around with this later tonight. Any tips as I do it?
Thanks