How can I filter related content types in Drupal? I'm building out a project management/project organization site with Drupal. The basic content types will be:


Projects 
Milestones (which belong to a project), and 
Tasks (which belong to a milestone)


I've built the Project content type. That was easy. I built the Milestone content type, and using the Node Reference module, I was able to access all of the Projects right in the from. Nice! But now Tasks get a bit tricky. Using the same technique, I could reference all of the Milestones in the Tasks form, but I really only want to see the Milestones that are associated with a specific Project. It seems that I would need to employ some kind of filter. How?

What's the best approach here? I have no module restrictions and am using the most current version of Drupal (7.8).
You could populate the second list manually by using the PHP code option to generate the values, the values could be something such as ProjectNid|TaskNid|Task Title.

You could then have a javascript hook so when a project was selected from the dropdown, it reads the nid value and then filters out the tasks where the first element (Project nid) doesn't match.

The other way would be reload the page after the project has been selected, and have the PHP code which populates the task field look at the current active value for Project and pull in the related tasks, or use a view with an argument set to achieve the same result.