68 - The HTMX Approach to Editing QuerySets - Python & Django 3.2 Tutorial Series

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

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

  • @floatpoint1050
    @floatpoint1050 10 หลายเดือนก่อน +1

    You Sir are a bloody genius. I almost overlooked this playlist because its based on 3.2 but I am relieved I didn't. For the past week or so I was struggling to populate Active Directory information on a page without refresh. My workaround was to store all GET data in variables and push them back into the form on reload with the associated AD data. Worked fine except for long pages which would switch back to the top. 25:50 is my solution. A humble thank you 😘

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

      Awesome. Keep up the efforts! And thank you.

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

    This particular video was one of the most tedious and mind numbing exercises I have ever done. You pulled that thing so far apart that it takes hours to backtrack and figure out what went wrong. Something about how you handle the form was a f.ckup, there was nothing wrong with the code itself. Hours. Wasted. On a complete triviality...
    Gonna start my project rather.

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

    Amazing tutorial. Just a few minutes in, I already knew this is the complete tutorial I have been looking for for the last few days. Great works!!! Thank you :)

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

    I really need this. Thanks

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

    Thanks very much for the tutorial(s). Very good video and explanations. Certainly very insightful and helpful. Some concepts are not as straight forward and can be confusing at first but I suppose they need just a bit of repetition as with anything really. Generally I am really enjoying this series a lot. Thank you for sharing your knowledge!

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

    I think at 21:10 we can simply write hx-post="{{ url }}" in ingredient-form.html as url is always defined in recipe_ingredient_update_hx_view

  • @JA-ur8ob
    @JA-ur8ob ปีที่แล้ว

    Thanks for the video. Just a question. Your current recipe_update_view does not allow the creation of instances. Although you say that it should allow both creating or editing, it doesn't. Do you cover this elsewhere?

    • @JA-ur8ob
      @JA-ur8ob ปีที่แล้ว

      I've figured it out but I am unable to render the 'add ingredient' button as it relies on an existing parent object which does not yet exist. Do I need to make another url that doesn't require a parent object id? I'm sure there's a better way.

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

      @@JA-ur8ob I still have no idea on how to handle creating new recipe and ingredients at once. were you able to fix this problem?

    • @JA-ur8ob
      @JA-ur8ob 4 หลายเดือนก่อน

      @@carlojanssens2174 I’ve actually abandoned HTMX altogether mate. I did some intensive JS videos and realised it wasn’t so bad. Did not pursue this any further.

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

    feel completely lost on this episode...doesnt seems easier that JS implementation. Probably reproducing helps to get it better

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

    For reference we are performing two things:
    1. Edit existing ingredient
    2. Add new ingredient
    for editing existing ingredient we are using ingredient-inline.html
    for adding new ingredient we are using ingredient-form.html
    when you click edit for an existing ingredient --> you are redirect to ingredient-form.html with existing ingredient instance data.
    As for the need for adding url to recipe_update_view we want to add new ingredient and so the request needs to be redirect to url with only parent id.
    Not sure if this helps to visualize if we had to create something from zero:
    1. start from create-update.html page or recipe edit page:
    a. we need to edit existing ingredients : for this we create ingredient-inline (to display each ingredient), ingredient-form(a way to edit existing ingredient)
    b. we need a way to add new ingredients: we can leverage the existing ingredient-form to create new ingredient but need to ensure that post request is send to create url

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

    This looks so complicated.... How do you add new ingredients when creating a new recipe? I've been trying for ages to figure this out....

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

      Me too, have you perhaps already found a solution? using only django and htmx?

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

    I have an issue, whenever I click on edit button, it gives me the edit form for ingredient, but then, when I click on save, it renders a RECIPE form with saved data.
    For the life of me, I cannot find a mistake in my code. Somehow, when I click the save button, it calls create recipe form instead of update ingredient. Any suggestions?
    I will look into it in detail tomorrow...

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

      Nailed it! I made a mistake when updating hx-post to {%if url%}..., I made the change into forms.html instead of ingredient-forms.html!. If anyone gets this same stupid error like me, this is the reason for it. Never code late at night without enough coffee :)

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

      Slightly similar issue for me, when I click the edit button it renders the whole recipe form and not an ingredient form. Gonna sleep on it and try again tomorrow but maybe the solution to yours might help me I hope. >_