In Views, how can I display an edit link if a node relationship exists, otherwise display an add link? I have a view of assignments, and want students to be able to post their work from that node. If they already have a work node, I want to display an edit link. Otherwise, I want to display an add link. In a previous version of this view, I used a Views PHP field that queried the DB for a work node matching the assignment, but I am rewriting the view because of a bug and I wanted to revisit this because it seemed a but ugly. Can anyone think of a better way?
I have had a similar situation and I did the following which is probably not the best thing to do - I will use your terms:


When an assignment node is created a work node for each student is created with the field field_submitted set to false
On the view, the field field_submitted is included but excluded from display
I have a php field with this code which displays edit or submit, both are actually sending to the same node but they will give the student some insight about what he should do next:

if(!empty($data->field_field_submitted[0]['raw']['value']))
   echo l(t('edit')/*, ... */);
else
   echo l(t('submit')/*, ... */);