Form wizard for multiple parent records.

In the Tasks edit form this is this nice way to select one related module and record for the relationship (one= project, many=tasks). Tasks can be associated with several modules. I have a custom module (donations) that likewise can be associated to either donor organizations or contacts. For custom modules it looks like i would have to have a separate field for each possible parent relationship. I want to have a similar dynamic drop down that creates/edits the relationship. Is this possible?

See attached to where it appears on the task edit form.

Looking at the code in modules/tasks it looks like this module uses “parent_type” and “parent_id” to allow the options of which module to select as the parent.

Ideally i’d like to be able to two parents. One where the options are a Donor or Contributor record and the other an option between Project and Account.

so maybe parent2_type and parent2_id

is this possible?
thanks
steve