I’m trying to create a car pool where I use HTMX in my Django project to make it work. The CarPool model consist of two FK. One FK is “City”, and the other is “Car”. I have it somewhat working. So within my two tables (one table with all the cars that have no city attached, and the other table displaying all the cars attached to the city that has been clicked), I’m able to use hx-post to add the car, and same to remove the car with the clicked city. But I don’t get the lists to update after they are clicked.
I have tried different ways of using hx-oob-swap but since I’m fairly new with both Django and HTMX I’m not sure where to exactly use it.
See attached pictures.
So picture “notclicked”, the left table shows all cars with no city, and the right table displays cars with “Chicago” as a FK. notclicked
Picture “clicked” I have now clicked on the car MMW 331 from the left table, and it adds it to the right table which is good, but then when I click on it, I want it also to be removed from the left table (same goes if I delete a car from the right table) clicked
Thankful for any help 🙂
Here is my test-repo from github: github
scaffnull is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.