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 😘
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.
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 :)
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!
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?
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 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.
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
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...
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 :)
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. >_
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 😘
Awesome. Keep up the efforts! And thank you.
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.
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 :)
I really need this. Thanks
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!
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
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?
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.
@@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?
@@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.
feel completely lost on this episode...doesnt seems easier that JS implementation. Probably reproducing helps to get it better
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
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....
Me too, have you perhaps already found a solution? using only django and htmx?
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...
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 :)
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. >_