Re: How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Constantine Covtushenko
Hi, Can you please describe why you did not want to call author.save() explicitly? What is wrong with this approach? Regards, Constantine C. On Mon, Dec 4, 2017 at 7:36 PM, Priyanka Thakur wrote: > Hi, > > > I want to create a bunch of objects that are interconnected

How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Priyanka Thakur
Hi, I want to create a bunch of objects that are interconnected in my model (eg, one Book and one Author object) and then call save() on the Book object to add everything to the database. In other words, I don't want to save Author object explicitly. Example: class Author(models.Model):