This tutorial will cover how to build dynamic forms in Django using Htmx. Dynamic forms feel like a breeze and we don't even have to work with formsets or JavaScript. class BookInLineAdmin(admin.TabularInline): from django.forms.models import inlineformset_factory, min_num=2, # minimum number of forms that must be filled in, extra=1, # number of empty forms to display, can_delete=False # show a checkbox in each form to delete the row, from django.shortcuts import redirect, render, books = Book.objects.filter(author=author), formset = BookFormSet(request.POST or None), return redirect("create-book", pk=author.id), return render(request, "create_book.html", context), path('/', create_book, name='create-book'), , ,
Create books for {{ author.name }}
,{{ book.title }} - {{ book.number_of_pages }}
,