Re: Many to many in template question

2007-06-08 Thread [EMAIL PROTECTED]
Thanks Russell. I'll go re-read them (again). One of these days they'll actually sink into my thick skull. On Jun 7, 7:09 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 6/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Figured it out. Template wanted (for whatever reason)

Re: Many to many in template question

2007-06-07 Thread Russell Keith-Magee
On 6/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Figured it out. Template wanted (for whatever reason) > {% for foo in bar.foos.all %} instead of {% for foo in > bar.foos_set.all %} This would all be a lot clearer if you would read the DB-api docs. The related-objects section explains

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
Figured it out. Template wanted (for whatever reason) {% for foo in bar.foos.all %} instead of {% for foo in bar.foos_set.all %} On Jun 7, 12:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm just getting more and more stumped. > > I went ahead and created a custom view for Foo, so that

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
I'm just getting more and more stumped. I went ahead and created a custom view for Foo, so that's taken care of, but Bar (which should be easy) isn't working either. I have: class Bar(models.Model): name= models.CharField(maxlength=100) foos = models.ManyToManyField(Foo, filter_i

Re: Many to many in template question

2007-06-07 Thread Russell Keith-Magee
On 6/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > That's what I thought, too, but I can't seem to access it. Maybe I > need to just write a custom view for this page. Based on what you've said so far, you shouldn't need to write a new view. You just need to reference the m2m data correc

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
That's what I thought, too, but I can't seem to access it. Maybe I need to just write a custom view for this page. On Jun 6, 4:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This doesn't exactly answer your question (because I'm a huge noob > still), but M2M relationships work in both >

Re: Many to many in template question

2007-06-06 Thread [EMAIL PROTECTED]
This doesn't exactly answer your question (because I'm a huge noob still), but M2M relationships work in both directions: http://www.djangoproject.com/documentation/db-api/#many-to-many-relationships I think to access it in the template, you'd just need to pass the information from your view? O

Many to many in template question

2007-06-06 Thread [EMAIL PROTECTED]
I know I'm making this harder than it has to be, but the logic is just escaping me. I've got two models, say "Foo" and "Bar" "Bar" establishes a manyToManyField relationship with "Foo": foos = models.ManyToManyField(Foo, filter_interface=models.HORIZONTAL, null=True, blank=True) I'm using a ge