27 - Basic Django Forms - Python & Django 3.2 Tutorial Series

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

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

  • @tigere01
    @tigere01 3 ปีที่แล้ว +10

    @11:03 - Absolutely, a freelancing course will be extremely useful.

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

      public poll

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

    best django course on yt!

  • @ahmetdiril824
    @ahmetdiril824 3 ปีที่แล้ว +6

    11:20 I see that you created two class methods clean_data and clean. But I don't see where you called them and how those print commands are being executed.

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

      When use is form.is_valid() in a view it calls the clean methods

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

      @@CodingEntrepreneurs Thanks for answering this. I was getting confused about the exact same thing.

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

      can someone explain why it actually works that way?

    • @a.r.khankashmir8264
      @a.r.khankashmir8264 2 ปีที่แล้ว +1

      @@CodingEntrepreneurs is both clean_title & clean method will be called?

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

      @@sastapts The clean_() method is called on a form subclass - where is replaced with the name of the form field attribute. This method does any cleaning that is specific to that particular attribute, unrelated to the type of field that it is.

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

    how does clean_title(), clean() having same way of calling the cleaned_data but still returning different values, clean_title() is only returning title, whereas clean is returning title, content, I had tried clean_content() to check with content only but it didn't work. Video at @12:04 please answer me. Thanks in advance....

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

    quality content all the way through, loving the tutorial, loving Django!

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

    if anyone get stuck in forms, don't worry it's normal
    so, what to do now?
    rewatch the video and write the code as the instructor wrote it keep working and rewatch the video until you get the same result that shown in the video, then search for each function you use (is_valid(), cleaned_data(), etc....) and understand the concept of this function (what the function do and what the function returns, when the function return False and when to return True as an example) this work with me
    if you don't understand it from the 10th time, don't worry, it take me 3 days to understand this basic form
    keep calm and work harder, that's the key
    last tip: if stuck in this video more than one week, go directly to the next video you'll see a better way

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

      No truer words have been spoken 😂😂

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

      @@chiomaobiajulu4363 thank you very much because you remind me with this comment, five months ago I wrote this comment and now I am still studying django and deep diving in other harder concepts, we have to work hard everyday, this is the secret .
      Thank you agian

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

      @@maamounhajnajeeb209 you’re welcome. I’m also refreshing my knowledge in Django. I want to build a project soon using Django and react in the front end. So I’m about to learn react for real. Lastly, I’m looking at playing a little with Django rest framework (which sounds intimidating but I have to try 🙏🏽)

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

      keep going@@chiomaobiajulu4363

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

    2:23 in {%if not created %} suddenly raise error with me unlike before I DON'T KNOW WHY !!!!

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

      erorr is not null constrain failed

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

    How can you modify how the form looks? I cant seem to target the html tags in css because they dont have class names. So how do i make the forms look nicer?

  • @Sumitkumar-ok7wp
    @Sumitkumar-ok7wp ปีที่แล้ว +1

    can anyone explain what is meant by cleaned cuz its too much unclear to me

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

      Raw input = dirty
      Django forms clean this data (preventing scripting attacks)
      Cleaned data = savable or usable.

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

    Thanks

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

    Hey, I see that you are using render() after doing POST and I read on on Django Official Tut Part 4 and some answers on StackOverflow that we should return with HttpResponseRedirect.
    Is there something I'm missing here? Also when I use render and refresh my page, the form gets submitted again.

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

      probably why I got "The view articles.views.article_create_view didn't return an HttpResponse object. It returned None instead."

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

    im super confused with this