HTMX + Django: Modern Python Web Apps, Hold the JavaScript Transcripts
Chapter: Feature 1: Click-to-edit
Lecture: Moving the click to edit link into a partial

Login or purchase this course to watch this video and the rest of the course contents.
0:00 I'm going to want to serve the ""Click to edit"" link from Django so it makes sense to move it into its own file.
0:09 This is similar to what I did with the form earlier. I'll create a new partial.
0:23 Open up the category, grab the link content, and paste it into its new home.
0:39 Of course, the link does need to be on the category page when the page first loads, though.
0:44 Rather than doing that dynamically, I'm going to use a Django include tag.
0:52 This include tag will pull the contents I just put into the partials file, into this template when the template is first rendered.
1:01 If you're coding along, this is a good spot to pause the video and check that everything still works.
1:07 The change I just made has only moved some code, it hasn't modified the functionality. Nothing should have been broken yet.


Talk Python's Mastodon Michael Kennedy's Mastodon