Designing a a system which needs state transitions of a model which are based on transitions of other models.
I'm using Django FSM
Example:
class Foo(models.Model):
baz = models.Charfield()
state = FSMField(default='new')
class Bar(models.Model):
x = models.CharField()
state = FSMField(default='draft')
foo = models.ForeignKey(Foo)
Use Case:
Foo can have the following states - new, draft, complete, pending_approval, approved Foo can have multiple Bars
Bar can have the following states - draft, complete
Foo should move to complete automatically when all Bar's are complete, how can this be achieved