I've implemented this sort of thing in the past. Without knowing your 
specific case, I guess that you have a parent model (ie. Pizza) and 1-n 
related child models (ie. Topping).

My advice is to redesign your flow to create a Pizza first then attach 1-n 
Topping entities to it. This would require two views and two forms.

If you want it all in one go, then write an API in REST Framework that does 
what I just said but via two calls from a single HTML page. You can write 
the HTML DOM manipulation in jQuery or ReactJS or whatever you are 
comfortable with. You will still end up with two calls: one to create your 
Pizza parent entity then subsequent calls to make Topping instances.

-k

On Wednesday, June 22, 2022 at 7:56:39 AM UTC-7 [email protected] wrote:

> The below image consists of a form layout the main form has it's model 
> defined and the subform has it's own model defined but I am getting problem 
> that how should I implement and also the subform is dynamic so how can I 
> implement it using htmx. Your help is appreciated. Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b2986a44-66f0-427e-b382-66ef976b20edn%40googlegroups.com.

Reply via email to