Тёмный

django-crispy-forms and HTMX integration #3 - Field validation and the hx-swap-oob attribute 

BugBytes
Подписаться 31 тыс.
Просмотров 8 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 2 года назад
Best Htmx series ever on RU-vid 😌. Thank you man. We impatiently are waiting for the next episode 😁🙌!
@bugbytes3923
@bugbytes3923 2 года назад
Awesome, thank you man!
@FirdausAziz
@FirdausAziz 2 года назад
I agree.
@grabskyyy
@grabskyyy 9 месяцев назад
Thanks so much for the entire Django & HTMX series - it had been a huge help! I'm still struggling to find a good way to replace only value attribute of forms input div. My goal is to create a form where HTMX is triggered when user starts typing name (like autocomplete), with a button next to it. When user presses the button, all relevant form inputs should be filled with details like tax number etc. Up to here everything works great. I can do what I want by rendering a partial that targets the particular divs, but to keep the div as initially defined I still need to include the entire HTML in the partials (basically the output of your as_crispy_field from 5:34). How do I only replace the 'value' attribute of that field and can crispy-forms help with that?
@isaachatilima
@isaachatilima Год назад
Hi I am not using Django for my backend but I want to try out HTMX. How do I keep my form validation on submit and only submit if form is valid using htmx?
@LeandroGurruchaga
@LeandroGurruchaga 5 месяцев назад
Do hoy know how to make tests for your example of crispy form fields with htmx triggers? Thanks
@myschored
@myschored 10 месяцев назад
Hi, I need this HttpResponse without CrispyForms... is posible?
@thing2know
@thing2know 2 года назад
its awesome tutorial. everything will perfect.but i have a doubt.i displayed the form with in the bootstrap modal.the form will be submitted correctly,but the data will not added to the list.can you make a video regarding to the bootstrap modal forms using django-htmx.it will be helpful.thanks.
@mitenmehta79
@mitenmehta79 2 года назад
in JSP we used to submit form and get all errors at once and then return all validation errros then instead of realtime how to do ? seems that we have to return full form with all validation errors put in correct place sounds like tedious same as we did in JSP.
@tobidegnon4409
@tobidegnon4409 2 года назад
Thanks so much, I learn so much in this series, I never thought on using crispy forms for more then the basic "crispy" tag
@bugbytes3923
@bugbytes3923 2 года назад
Nice one, thanks for the comment and glad you enjoyed!
@dominiqueremy4868
@dominiqueremy4868 Год назад
Thank you so much. I added default=0 to subject and null=True (date_of_birth) to avoid errors in case of creating a superuser.
@bugbytes3923
@bugbytes3923 Год назад
Thank you Dominique - good tips there, I should have included some defaults! Thanks for watching.
@LeandroGurruchaga
@LeandroGurruchaga 2 года назад
The tree videos are excellent, thanks ! I'll try to apply this approach to a project under development actually with adminlte template with carda on bootstrap .Is important with this package that all the code are un .py's
@bugbytes3923
@bugbytes3923 2 года назад
Thank you Leandro, appreciated! Good luck with your project!
@Razilator
@Razilator 2 года назад
Hello, these are great tutorials! Very nice to watch! Can you suggest an extension for vs code that shows the latest commit and edit time?
@bugbytes3923
@bugbytes3923 2 года назад
Thank you, glad you're enjoying! The extension I'm using is called GitLens.
@craigphollingsworth1460
@craigphollingsworth1460 2 года назад
Great vid again. Really helpful! Thanks! Would be interesting to see a similar example with a Model choice field . I'm just getting dictionaries showing in the select. anyhoos, will keep playing. Thanks again!
@bugbytes3923
@bugbytes3923 2 года назад
Thanks Craig! I'm not sure if this is the issue you're having, but you could try adding a __str__(self) method to your model - that might help there. Example here: docs.djangoproject.com/en/4.0/ref/models/instances/#str
@craigphollingsworth1460
@craigphollingsworth1460 2 года назад
@@bugbytes3923 thanks for the response. Appreciated. Turned out I was returning values on the query rather than a queryset (and this was offscreen on my laptop - good little lesson on code formatting). What a numpty! haha. :-)
@fine-vine
@fine-vine Год назад
I looooove your htmx videos. So many thanks
@bugbytes3923
@bugbytes3923 Год назад
Thanks a lot, that's good to hear! Thank you for watching.
@juanbetancourt5106
@juanbetancourt5106 2 года назад
Thank you for sharing your knowledge.
@bugbytes3923
@bugbytes3923 2 года назад
You're welcome, thanks for commenting!
@Youdude2
@Youdude2 2 года назад
Can you do a video on a django-crispy-forms with a modal and htmx integration?
@JustinSpryce
@JustinSpryce 2 года назад
I am loving this ... more HTMX tutorials please
@bugbytes3923
@bugbytes3923 2 года назад
Thank you! Yes, more upcoming ;)
@DenisCardosoTutor
@DenisCardosoTutor Год назад
This tutorial is so helpful and I´d like to know if there is a way to make a check function that generates a selection box as a crispy field.
@andreaszweili8593
@andreaszweili8593 2 года назад
Do you have a plan to do a video where you create a Modal on top of another form so that you can for example extend a select field while the user is filling out a form?
@theindianhindu1458
@theindianhindu1458 2 года назад
Awesome demo on HTMX.
@bugbytes3923
@bugbytes3923 2 года назад
Many thanks!
@mentotong9652
@mentotong9652 2 года назад
Thank you so much for this awesome tutorial, as always. Just one question about this subject, if I have a variable that is not in the htmx form to perform swap, how can we use the hx-swap-oob to update the attribute?
@andywang1352
@andywang1352 Год назад
I have this problem too. Do you have good solution? bro...
@scknylmz
@scknylmz 2 года назад
You are awesome and I am sure that you are not any idea how you encourage us to use htmx also you have no idea how you teach us valuable things. thank you so much again, Even though I know the subject, I learn new things and discover new things :)
@bugbytes3923
@bugbytes3923 2 года назад
Thank you, friend! I'm glad it is useful for you.
@scknylmz
@scknylmz 2 года назад
​@@bugbytes3923 while I get username validation error then I got validation error for "subject". "Submit" button is disabled (It is ok for now). But even I dont change username (still is unvalid) just change "subject" "Submit" button is enabled. Because our "check_username" functions is running and valid is true. Is there any way to fix this? I tried to get is_valid form from django but in this case it returning just username as valid. others are empty. Thanks in advance...
@scknylmz
@scknylmz 2 года назад
Again me, I solved my problem as I added 'hx-include': '[name="date_of_birth"], [name="subject"], [name="password"]' and also put is_valid() if statement in views.py
@bugbytes3923
@bugbytes3923 2 года назад
@@scknylmz Hey man - great to hear you got that solved! Nice solution there too - hx-include is a very useful attribute in HTMX, generally!
Далее
Трудности СГОРЕВШЕЙ BMW M4!
49:41
Просмотров 1,7 млн
Forms And Validation With Golang, Templ And HTMX
7:40
HTMX - What they don't want you to know!
13:28
Просмотров 85 тыс.
HTMX: 3 IRL Use Cases
18:33
Просмотров 118 тыс.
HTMX Is Amazing And This Is Why
7:48
Просмотров 42 тыс.
Create a Dependent Select Field in Django With HTMX
14:37
HTMX Sucks
25:16
Просмотров 124 тыс.
5 JavaScript Concepts You HAVE TO KNOW
9:38
Просмотров 1,4 млн
Forms Will Never Be the Same
10:10
Просмотров 56 тыс.