State machine for django models.