Last active
December 16, 2021 17:05
-
-
Save katipogluMustafa/59db048646b8ad7a777b0f3d6cea9f18 to your computer and use it in GitHub Desktop.
Django retrival of Tinymce non-input fields from a HTML form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit_story(request, story_id): | |
if request.method == "POST": | |
title = request.POST["mce_0"] | |
description = request.POST["mce_2"] | |
content = request.POST["mce_3"] | |
update_story_object(story_id, title, description, content) | |
return redirect("show_story_page", story_id) | |
else: | |
story = get_object_or_404(Story, pk=story_id) | |
return render(request, "edit_story.html", {'story': story}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment