Saturday, April 25, 2015

Re: Admin Inlines

For reference.  My mistake is that I really have a ManyToMany relationship and I used this 
to solve the problem. 

Thanks to Ryan McDevitt.




On Sat, Apr 25, 2015 at 3:11 PM, Timothy W. Cook <tim@mlhim.org> wrote:
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 Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3VBk%2BKnFEUiBsVZ-r32ZEW75K0b_RgqZHheBTY2ik%2BDtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment