I saw several blog posts (e.g. one from yergler) about this, but couldn't find a nice elegant solution.
I have 3 models:
class Workflow(models.Model):
name = models.CharField(max_length=255)
company = models.ForeignKey(Company)
class Meta:
unique_together = ('name', 'company')
class Milestone(models.Model):
workflow = models.ForeignKey(Workflow)
tasks = models.ManyToManyField(Task)
class Task(models.Model):
task = models.CharField(max_length=255)
How can I create a form that allows me to add many steps to the workflow and many milestone tasks?
Basically, I want to give them a create form or an edit form and let them create a workflow with milestones and tasks, but would like to let them dynamically add them using javascript.
The dynamic / javascript part is simple, but I could not figure out how to insert a form set inside a form set. that is, Tasks under the milestone.
source
share