Admin Inlines

11 views
Skip to first unread message

Timothy W. Cook

unread,
Apr 25, 2015, 2:11:21 PM4/25/15
to django...@googlegroups.com
The usage of AdminInlines seems backwards to me.

At least in the use case I have.  

I have two  models:

DvInterval:
    lower = models.CharField(max_length=110)
    upper = models.CharField(max_length=110)
    ...
  

 ReferenceRange: 
​  ​
​ ​   ...

​    data_range = models.ForeignKey(DvInterval)



​Since a ReferenceRange may have many DvIntervals defined I would like to be able to edit them on the ReferenceRange admin page in a StackedInline. 
Kind of makes sense, right?  Add the intervals for this range.  At least that is what my users want. 

But the functionality of inlines wants me to put the ReferenceRange(s) on the DvIntervals page.  Most intervals will only be on one ReferenceRange but a ReferenceRange may have several intervals. 

Where is my modeling mistake? 

Thanks.






============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

Timothy W. Cook

unread,
Apr 25, 2015, 2:29:13 PM4/25/15
to django...@googlegroups.com
For reference.  My mistake is that I really have a ManyToMany relationship and I used this 
to solve the problem. 

Thanks to Ryan McDevitt.



--
Reply all
Reply to author
Forward
0 new messages