generic views and non-editable foreign keys

2007-01-13 Thread qhfgva
So far I've been using generic views for everything so I'm not sure if I've reached the end of what those can do, or just need some better understanding of how to use them. I have a Foo model and a Goo model which among other attributes has a non-editable ForeignKey reference back to Foo. I'm h

Re: generic views and non-editable foreign keys

2007-01-13 Thread Honza Král
I would recommend you reading this blog by James Bennet: http://www.b-list.org/weblog/2006/11/16/django-tips-get-most-out-generic-views it has some great tips on using and extending generic views... On 1/14/07, qhfgva <[EMAIL PROTECTED]> wrote: So far I've been using generic views for everyth

Re: generic views and non-editable foreign keys

2007-01-16 Thread qhfgva
Thanks for the link. Using a wrapper is one of the things I had tried. Here is what I tried. I *think* I'm close, but I don't see the last little bit that I'm missing: models.py class Foo(models.Model): charfoo = models.CharField(maxlength=10) class Goo(models.Model): chargoo = mod

Re: generic views and non-editable foreign keys

2007-01-16 Thread Maxime Biais
On 17 jan, 06:31, "qhfgva" <[EMAIL PROTECTED]> wrote: Thanks for the link. Using a wrapper is one of the things I had tried. Here is what I tried. I *think* I'm close, but I don't see the last little bit that I'm missing: models.py class Foo(models.Model): charfoo = models.CharFiel

Re: generic views and non-editable foreign keys

2007-01-18 Thread qhfgva
I think you have a small error in your example. Should be: class Thing(models.Model): #element = models.ForeignKey(Thing) element = models.ForeignKey(Element) name = models.CharField(maxlength=100) Also I figured out my problem (I think). I was passing ForeignKey editable=False, appa

Re: generic views and non-editable foreign keys

2007-01-19 Thread Maxime Biais
On 1/19/07, qhfgva <[EMAIL PROTECTED]> wrote: I think you have a small error in your example. Should be: class Thing(models.Model): #element = models.ForeignKey(Thing) element = models.ForeignKey(Element) name = models.CharField(maxlength=100) Thank you, corrected. So I guess