django-crispy-forms & ModelChoiceFields / Select2 Integration for Searchable Form Fields

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

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

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

    Hello bro its a request please create a multilevel dropdown/nested with search functionality and data having icons too , htmx will be good or you can use anything i found no solution for this

  • @가팔르아이수
    @가팔르아이수 4 หลายเดือนก่อน +2

    This is one of the best videos on TH-cam and I just love it.🔥🔥🔥👍🏻🤩

  • @TomislavMiletic
    @TomislavMiletic 5 หลายเดือนก่อน

    Thank you for this :)
    Is there a way to just limit the number of objects shown, like if you are this Car object and you have 100 objects, you don't want to query by country, what if you just don't want to show all 100 objects in the dropdown?
    Also can we make this search result trigger a child element so it becomes dependable? It only works with the regular django + htmx select parent (FK) that triggers the child element objects to be shown in the options below, but with this search, it doesn't work ...

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

    Obrigado me ajudo bastante sucesso pra você

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

    heey I was looking for this but with one addition. what if the car isn't there availble, how to make it go quickly create a new one without leaving the main form page? have any tips for me here? thanks a lot mate.

  • @ChrisBoendermaker
    @ChrisBoendermaker 5 วันที่ผ่านมา +1

    This guy is a bloody legend! The content was clear, concise and very well explained. Nothing was left out. Champion!!

    • @bugbytes3923
      @bugbytes3923  3 วันที่ผ่านมา

      Thanks a lot, appreciate it!

  • @muhammadmasruri7230
    @muhammadmasruri7230 4 หลายเดือนก่อน

    how to change the strip that appears as a result of using foreign keywords in the input form?

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

    Oh no! jQuery 😆 ... great video BTW (as usual)

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

      Lots of projects still need jQuery.

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

      Background using jQuery in select2 package.

  • @jimmyf.x.9526
    @jimmyf.x.9526 5 หลายเดือนก่อน +1

    The most comprehensive examples of the most frequently used features such as crispy form, muti select, many to many, como box in a concise video. Thanks!

    • @bugbytes3923
      @bugbytes3923  5 หลายเดือนก่อน

      Thanks a lot, really appreciate it!

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

    Great video as always. select2 is a gold discovery! 🥳👍

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

      Glad to hear it, it's a cool tool, and thank you!

  • @federicocampo557
    @federicocampo557 11 หลายเดือนก่อน

    Hello, can you explain how use select2 with dynamic formsets?

  • @MarvinJosueSalazarGarcia
    @MarvinJosueSalazarGarcia 13 วันที่ผ่านมา +1

    muchas gracias

    • @bugbytes3923
      @bugbytes3923  11 วันที่ผ่านมา

      Gracias por ver!

  • @amine63404
    @amine63404 7 หลายเดือนก่อน +1

    Thank you very much, this is exactly what I was looking for.

    • @bugbytes3923
      @bugbytes3923  7 หลายเดือนก่อน +1

      Awesome - thanks for watching!

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

    I have encountered an issue where using render_block_to_string to respond to an HTMX Ajax call for replacing choice fields, which were initially set with select2(), causes jQuery not to affect these fields anymore. To resolve this, I had to add a script using htmx.onLoad to reattach select2() to the choice fields. However, there's a small problem. How can I prevent lag from happening between onLoad events?

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

    You are the best! Thanks for compact and complete overview

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

      Thanks for the nice comment!

  • @mr.yayaman
    @mr.yayaman ปีที่แล้ว +1

    What I exactly need 😊 thank you for this.

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

    how do we implement models and select2 to allow user to add a new car that isnt in our database? in select2 documentation there is someting like "tags: true" that allows you to enter a new tag (a new car in this case) but i dont know hot to get it working with django. right now if i only add tangs:true and try to enter a new car it shows this forms error: Select a valid choice. That choice is not one of the available choices.

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

      У тебя в field.select в post запросе должно быть это новое значение. Иначе is_valid не пропустит

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

      sorry. aming:
      if request.method == 'POST':
      form = OrderForm(request.POST)
      form.fields['client_company'].queryset = ClientCompany.objects.filter(client_id=client.id)

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

    When is the finance tracker project demo dropping?

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

    Cool video,this was a problem for me in the past ,tried autocomplete light but it wasn't elegant.Django select2

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

      Same, I had some issues with autocomplete-light. Thanks!

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

    Thanx for the video it explains a lot.
    But a question what do you prefer tailwind or bootstrap in combination with Django?

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

      Thanks! I like both, to be honest. Maybe prefer Tailwind, slightly.

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

    Been waiting for one tuto of yours this week, finally it arrived 😩! The Django GOAT 🙏🏾🙌🏾! Thank you Master.

  • @wiki-infodevelopment3369
    @wiki-infodevelopment3369 ปีที่แล้ว +1

    Like always, you are the best 😍

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

    Great gist. I integrated select-2 in my current project. I'm happy you're throwing more lights on it.

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

      Thanks! Select2 is cool, nice and easy to use and very useful.

  • @benkal540
    @benkal540 2 หลายเดือนก่อน

    So great ! Amazing! 🤩

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

    what an amzing tutorial 🧡🧡

  • @Zeksait
    @Zeksait 9 หลายเดือนก่อน

    дай я тебя обниму!
    Лучшая структура видеоурока:
    теория и практика. После твоего объяснения не остается вопросов и все получается повторить с первого раза. Так же видео не длительное и не утомляет.
    Молодец, хорошо поработал над структурой повествования! ПОДПИСАЛСЯ

    • @Zeksait
      @Zeksait 9 หลายเดือนก่อน

      В админке можно на странице модели при выборе model_choice_filed можно нажать на "+" и появится popup окно для создания нового объекта. после создании, этот объект будет выбран в поле. Во всем ютубе не могу найти - как сделать это в своей форме.. Может быть хорошая идея для твоего следущего видеоурока! =)

  • @KhanhTran9881
    @KhanhTran9881 7 หลายเดือนก่อน

    Hi, thank you so much for this very helpful clip!

    • @bugbytes3923
      @bugbytes3923  7 หลายเดือนก่อน +1

      Thanks a lot for watching!

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

    great stuff!,
    and how to make the car field dynamically displayed (not the entire queryset, but for example, we enter letters and it is dynamically completed and we can choose an element from what we have filtered)?

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

      Thanks!
      I think select2 in the video does this? Or have I misunderstood what you mean?

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

      @@bugbytes3923 for example: we have 500 cars (too many to display in the selection field), we enter the names and dynamically this list is completed and then we can choose what interests us

  • @AliHassan-wc6nb
    @AliHassan-wc6nb ปีที่แล้ว

    Hi, can you do the same thing crispy tailwind?

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

    Great Video bro. Thank you so much.

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

    thankyou

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

    pip install django_compressor give me tutorial

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

      I'll do something on django-compressor soonish!

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

    thank

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

    Thank

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

    Choices is better than select2 because it doesn't require jQuery

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

      What if you have thousands of choices to choose from?say clients data.

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

      @@repotranstech9614 Choices allows search through fetch api.

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

    Much awaited! Happy as heaven!

  • @mahmoudramadan4237
    @mahmoudramadan4237 9 หลายเดือนก่อน

    thank you, amzing !

    • @bugbytes3923
      @bugbytes3923  9 หลายเดือนก่อน +1

      Thanks a lot!

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

    Thank you!

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

    Great lesson, sir

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

    greaaaaaaaaaat master
    👍👍👍👍

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

    Superb and awesome