I enjoy Django most of the time, but formsets drive me up the wall whenever I use them.
-
-
Baptiste Mispelonreplied to Marijke Luttekes last edited by
@mahryekuh if that helps, you're not alone out there.
I've always been happier manually managing form prefixes, formsets never seem to work the way I want them to ️ -
Marijke Luttekesreplied to Baptiste Mispelon last edited by
@bmispelon Yeah, I've heard this a couple of times. There is something to win here, either in functionality or documentation, but I don't know *what* yet.
-
Jeff "weBOOOOlogy" Triplettreplied to Marijke Luttekes last edited by
@mahryekuh they are harder then it feels like it should be and then troubleshooting.
Once I have it working, it always feels like it took less code than I thought it should.
I keep meaning to write it up, but enough time passes that I feel like I'm starting over each time.
-
Marijke Luttekesreplied to Jeff "weBOOOOlogy" Triplett last edited by
@webology Hard agree. There is little code to write, but it is tricky to understand.
I am currently (well, have been for the past few hours) fighting with sort orders stored in the DB, but I also need to sync with the form sets and then some JavaScript to make them autofill only when the rest of the form row isn't empty.
I recognize the desire to write about them and then lose the knowledge again.
-
Marijke Luttekesreplied to Marijke Luttekes last edited by
I fixed one of the last remaining issues!
(Not in a way I can reproduce in an article right now.)
-
@mahryekuh I use HTMX to get rid of formsets. Each related object can be updated independently
-
@andywar65 I don't use HTMX (or other JS frameworks).
-
@andywar65 I don't use HTMX (or other JS frameworks).
In this particular project, I couldn't do it even if I wanted to since it would directly harm the usability of the form for the primary audience.