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

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024

ความคิดเห็น • 33

  • @shuvra03
    @shuvra03 2 ปีที่แล้ว +3

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

    • @jnscollier
      @jnscollier 2 ปีที่แล้ว

      Underrated? First, what a rude and mindless thing to say. Second, it's just not true so you must be conversing with some A-holes.

  • @user-iq2wp8ki7v
    @user-iq2wp8ki7v 3 ปีที่แล้ว +3

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

    • @CodingEntrepreneurs
      @CodingEntrepreneurs  3 ปีที่แล้ว +2

      There’s probably a Django package (non-official) that does this.

  • @SuperMoose1231
    @SuperMoose1231 2 ปีที่แล้ว +2

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

  • @alumnoapellido
    @alumnoapellido 6 หลายเดือนก่อน

    THANK FOR THE TUTORIAL BROTHER 💕

  • @rickmonarch4552
    @rickmonarch4552 2 ปีที่แล้ว

    This thing saved my life bro

  • @THEBR0WNGUY
    @THEBR0WNGUY 3 ปีที่แล้ว +1

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

  • @chrisogonas
    @chrisogonas 2 ปีที่แล้ว

    Great stuff. Thanks

  • @allifmaalengineeringlimite9853
    @allifmaalengineeringlimite9853 3 ปีที่แล้ว +4

    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.

    • @lucasmbaca6126
      @lucasmbaca6126 2 ปีที่แล้ว

      i have the same question !!!

  • @aadilmalik9802
    @aadilmalik9802 3 ปีที่แล้ว

    You are incredible buddy

  • @JasonVriends
    @JasonVriends 2 ปีที่แล้ว

    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?

  • @maytheri
    @maytheri ปีที่แล้ว

    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'.

  • @drustan6890
    @drustan6890 8 หลายเดือนก่อน

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

  • @consciouschords
    @consciouschords ปีที่แล้ว

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

  • @vinayagarwal7
    @vinayagarwal7 2 ปีที่แล้ว

    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

  • @QLOVEm3OFCChannel
    @QLOVEm3OFCChannel 2 ปีที่แล้ว

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

  • @ToMussic
    @ToMussic 2 ปีที่แล้ว

    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

  • @Vicmendon
    @Vicmendon 3 ปีที่แล้ว

    Thank you so much!

  • @declivee
    @declivee 2 ปีที่แล้ว

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

  • @travismiller3636
    @travismiller3636 2 ปีที่แล้ว

    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?

    • @DhavalAhir10
      @DhavalAhir10 ปีที่แล้ว

      Yes.. When you remove anyone even from the middle or last one... Simply re arrange it to 0 to end

  • @yavener
    @yavener ปีที่แล้ว

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

  • @iotdude
    @iotdude 2 ปีที่แล้ว

    awesome !!

  • @doctorplusclub2735
    @doctorplusclub2735 2 ปีที่แล้ว

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

  • @ashir3730
    @ashir3730 2 ปีที่แล้ว

    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...

    • @CodingEntrepreneurs
      @CodingEntrepreneurs  2 ปีที่แล้ว +5

      It takes time my friend. It took me time and a LOT of frustration

    • @ashir3730
      @ashir3730 2 ปีที่แล้ว +1

      @@CodingEntrepreneurs So happy to see your reply, Sir. Thank you very much Sir for giving your valuable time and words. I won't forget this reply for my whole life. It means a lot to me. Keep up the Great Work Sir.

  • @SoulScribbler
    @SoulScribbler 3 ปีที่แล้ว

    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 (~).

    • @CodingEntrepreneurs
      @CodingEntrepreneurs  3 ปีที่แล้ว +1

      Oh yeah. That’s modern JavaScript

    • @CodingEntrepreneurs
      @CodingEntrepreneurs  3 ปีที่แล้ว

      Very similar to f-strings in python

    • @SoulScribbler
      @SoulScribbler 3 ปีที่แล้ว

      Ah ok just a different way it's done pretty much. Thanks