64 - Dynamic New Forms in a Django Formset via JavaScript - Python & Django 3.2 Tutorial Series

preview_player
Показать описание
64 - Dynamic New Forms in a Django Formset via JavaScript - Python & Django 3.2 Tutorial Series

Try Django 3.2 is a series to teach you the fundamentals of creating web applications with Python & Django by building a real project step-by-step.

Рекомендации по теме
Комментарии
Автор

Thanks for tutorial,
is there any chance of disregarding the empty prefix form initially as i have a required widget for a field and its not letting me submit

roshanpaul
Автор

I don't know why are you so underrated. But you explained really well. Good job, bro! Keep it up.

shuvra
Автор

Thank you for this tutorial, I was trying to implement something similar

THEBRWNGUY
Автор

Great list of videos! Django should provide some JS helpers for adding new formsets dynamically imo.

iqwpkiv
Автор

Great video. How can we delete extra forms now? Like in the django admin inline?

SuperMoose
Автор

How do you ensure that counts you update via setAttribute actually get passed in the request? The add button will increment the id_forms-TOTAL_FORMS, but when I print the request in python it still says '0'.

maytheri
Автор

Is there a way in the ' for fields in self.fields ' to determine the type of the field so you can update the CSS based on each type i.e. checkbox etc?

JasonVriends
Автор

Nice video.. can you please do the dynamic form on the create view because every time the dynamic form is generated on the update view, there is other prefillled fields.

allifmaalengineeringlimite
Автор

Django doesn't do field validation for dynamically added forms. how do I do validation?

drustan
Автор

I have a query.. I am also using Javascript to add element using hx-target and the element I am adding has hx-get in it ... so the dynamic addition of element using javascript is working but the hx-gext inside that dynamic element is not working

vinayagarwal
Автор

Can you do tutorial on how to pre populate data of the forms with formset

consciouschords
Автор

Hello! Can you do also a delete product line function ?

QLOVEmOFCChannel
Автор

Thanks for the great tutorial. Could you also show us how to add ingredients with a new recipe in one go using htmx? Thank you

ToMussic
Автор

What about buttons to *remove* ingredients? I assume that any ingredients which appear *after* the one being deleted would need to be resequenced, so there are no gaps? (e.g., form-4-* would become form-3-*, etc.)

Also: what if you have two formsets on the same page? Can you customize the names and IDs of the controls in the management form, so they don't collide?

travismiller
Автор

What might look strange: declaring of formCopyTarget as 'const' and then appending to it. This works for arrays in JS.

yavener
Автор

Hello, thanks for the code! But, how to delete ingredient-form?

declivee
Автор

Hello, Can you give me tutorial to delete inline form like django admin ?

doctorplusclub
Автор

THe string substitution at 22:20 really threw me off since it doesn't use quotes ( ' ' ) and instead uses backquote ( ` ` ). Why is that?

For anyone who might have the same issue, backquote is the character on the same key as tilda (~).

SoulScribbler
Автор

Hey, Sorry sir Justin Mitchell. But sometimes I kind of feel so busted and punctured knowing about, you know so many things. In Deep Sorrow, Writing I'm feeling jealous really a lot...

ashir