Django & HTMX App - Deleting Data with HTMX | hx-confirm attribute

Published: 27 June 2024
on channel: BugBytes
2,236
138

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes

⭐Top resource to learn Python - https://datacamp.pxf.io/kOjKkV ⭐

In this video, we'll add functionality to delete user transactions in the application. We'll wire all of this up with HTMX, and will prompt users to confirm they want to delete a resource using the hx-confirm attribute.

We'll also write a test with pytest, for the delete transaction functionality.

Github: https://github.com/bugbytes-io/Django...

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:00 Adding Django URL and View for deleting transaction
04:41 Adding hx-delete attribute to delete icon
06:33 Getting confirmation from user with hx-confirm attribute
08:08 Testing delete functionality with Pytest

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/Django...
🐦 Twitter:   / bugbytesio  

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
hx-confirm: https://htmx.org/attributes/hx-confirm/
HeroIcons: https://heroicons.com/
HTMX: https://htmx.org/docs/


#python #django #webdevelopment #htmx