In this video, we look at how to extract values from GET requests in Django. We look at the nuances of extracting multiple values for a single field, for example from a form submission with a "select multiple" field, and how to process these in the backend.
We'll also see how to use django-filter to extract the logic of filtering away from our View code.
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugbytes
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
06:07 Django QueryDict getlist() method
08:35 Filtering servers by GET parameter values
11:47 Using Django-filter MultipleChoiceFilter
▶️ Full Playlist:
• Django ORM Deep Dive
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: bugbytes.io/posts/
👾 Github: github.com/bugbytes-io/
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
QueryDict objects: docs.djangoproject.com/en/4.2...
django-filter: django-filter.readthedocs.io/...
#python #django #webdevelopment
30 июн 2024