Skip to content
Advertisement

Tag: django-models

Saving related model objects in single view

I am beginner and I am working on Django project – risk assessment application. I have a trouble to achieve saving on related objects for my application risk record. I am using MultiModelForm to achieve the following. I am successfully creating Whatif instance and connecting it with GuideWordi instance on save, however, I am not able to connect my RiskRecordi

A count of ForeignKey

I have class Team, which means a group of users. And the relation with User is One-to-Many. But Team may consist of 2 and N members. I think to write manually is not our way, because it depends on count of people which is always variable. How can I do it more elegant and rational? I mean to connect count

Advertisement