You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been searching about it and I found that we could use InlineFormAdmin and InlineOneToOneModelConverter for one-to-one inline models and a similar approach for one-to-many models but my goal is to offer an option.
Search and select the child model, if it doesn't exist, then create it while creating the parent model. Is this possible? As far as I searched, I couldn't find any method of doing this.
Let's say that we have two tables, owners and cars. A car can only have one owner but an owner can have multiple cars. Let's say that I have more columns to record in the database and I want to add Cars first with their Owners but what if the owner is already in my database? I may search id and select in on the same create form but what if not, then I should go to the Owner View and add an Owner and then I should come back and edit the Owner, right? My goal is basically add or select an owner when creating a car record.
The text was updated successfully, but these errors were encountered:
hasansezertasan
changed the title
One-To-One relationship, Select or Add Inline model in the Parent Model View?
One-To-Many relationship, Select or Add Inline model Option in the Parent Model View?
Jun 17, 2023
Hey everyone 👋
I've been searching about it and I found that we could use
InlineFormAdmin
andInlineOneToOneModelConverter
for one-to-one inline models and a similar approach for one-to-many models but my goal is to offer an option.Search and select the child model, if it doesn't exist, then create it while creating the parent model. Is this possible? As far as I searched, I couldn't find any method of doing this.
Let's say that we have two tables,
owners
andcars
. A car can only have one owner but an owner can have multiple cars. Let's say that I have more columns to record in the database and I want to add Cars first with their Owners but what if the owner is already in my database? I may search id and select in on the same create form but what if not, then I should go to the Owner View and add an Owner and then I should come back and edit the Owner, right? My goal is basicallyadd or select an owner
when creating a car record.The text was updated successfully, but these errors were encountered: