views:

390

answers:

0

I have these models:

(pseudocode)

Course:  
  ForeignKey(Outline, null=True, blank=True)  
  ForeignKey(OutlineFile, null=True, blank=True)

Outline:    
  //data

OutlineFile:    
  //different data

The situation is that any course can have an Outline associated with it, and/or an OutlineFile, or neither. An Outline can be associated with multiple courses, similarly an OutlineFile can be associated with multiple courses. However, a course will only ever have at most one of each.

What I want is to have the Course change admin page show all the Course fields, and a drop down for each of Outline and OutlineFile. If one is then selected, I want the fields for that Outline to be displayed and modifiable, just like an inline field.

Should I be restructuring my models somehow, or are they structured adequately already? Is there anyway to do what I want within the confines of the current inlines system?

Lastly, if it's not possible, where do I start in doing it in a custom fashion?