Django form not saving with ModelChoiceField - ForeignKey
问题 I have multiple forms on my site that work and save info to my PostgreSQL database. I am trying to create a form to save information for my Set Model: class Set(models.Model): settitle = models.CharField("Title", max_length=50) setdescrip = models.CharField("Description", max_length=50) action = models.ForeignKey(Action) actorder = models.IntegerField("Order number") The Set Form looks like this. I am using ModelChoiceField to pull a list of Action name fields from the Action model, this