Re: Display Data From Multiple Tables

2009-07-02 Thread AmanKow
On Jul 2, 10:25 am, The Danny Bos wrote: > DR. > Bingo!! > > Thanks man, > And thanks for the tip on "_set" being for ForeignKeys. > > d > > On Jul 3, 12:23 am, Daniel Roseman wrote: > > > On Jul 2, 3:20 pm, The Danny Bos wrote:> Daniel, > > > > {% for author in review.item.author_set.all %} >

Re: Display Data From Multiple Tables

2009-07-02 Thread TiNo
> > TINo, no errors at all, it just doesn't display. Wat doesn't display? The publisher name? The authors? > > Agreed it is a ManyToMany type. Am thinking perhaps a ForeignKey type > may work just fine. Any reason you guys can think of that an Author > field should be a ManyToMany? > Depends.

Re: Display Data From Multiple Tables

2009-07-02 Thread The Danny Bos
Daniel, {% for author in review.item.author_set.all %} Is what I've been using. TINo, no errors at all, it just doesn't display. Agreed it is a ManyToMany type. Am thinking perhaps a ForeignKey type may work just fine. Any reason you guys can think of that an Author field should be a ManyToMany?

Re: Display Data From Multiple Tables

2009-07-02 Thread The Danny Bos
DR. Bingo!! Thanks man, And thanks for the tip on "_set" being for ForeignKeys. d On Jul 3, 12:23 am, Daniel Roseman wrote: > On Jul 2, 3:20 pm, The Danny Bos wrote:> Daniel, > > > {% for author in review.item.author_set.all %} > > Is what I've been using. > > Aargh, copy and paste fail. S

Re: Display Data From Multiple Tables

2009-07-02 Thread Daniel Roseman
On Jul 2, 3:20 pm, The Danny Bos wrote: > Daniel, > > {% for author in review.item.author_set.all %} > Is what I've been using. > Aargh, copy and paste fail. Should have been {% for author in review.item.authors.all %} -- DR. --~--~-~--~~~---~--~~ You received this

Re: Display Data From Multiple Tables

2009-07-02 Thread Daniel Roseman
On Jul 2, 2:55 pm, The Danny Bos wrote: > K, I think I have it. > > Just having trouble getting the Author loop from within my Review > set. > Here's what I have below, I figured this was pretty close but I'm > wrong aren't I? > >         {% for review in reviews_full %} >                 {{ revi

Re: Display Data From Multiple Tables

2009-07-02 Thread TiNo
On Thu, Jul 2, 2009 at 15:55, The Danny Bos wrote: > Just having trouble getting the Author loop from within my Review > set. > Here's what I have below, I figured this was pretty close but I'm > wrong aren't I? Does it give you any errors? >{% for review in reviews_full %} >

Re: Display Data From Multiple Tables

2009-07-02 Thread The Danny Bos
K, I think I have it. Just having trouble getting the Author loop from within my Review set. Here's what I have below, I figured this was pretty close but I'm wrong aren't I? {% for review in reviews_full %} {{ review.item.title }} {{ review.item.publisher

Re: Display Data From Multiple Tables

2009-07-02 Thread Alex Robbins
You should take a look at select_related[1]. It will take the lot of queries TiNo was talking about and flatten it down to one big one. [1] http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 Hope that helps, Alex On Jul 1, 1:34 pm, TiNo wrote: > On Wed, Jul 1, 2009 at 16:59, The Da

Re: Display Data From Multiple Tables

2009-07-01 Thread TiNo
On Wed, Jul 1, 2009 at 16:59, The Danny Bos wrote: > > Hi there, > > Seems easy, but I'm having an ass of a time. I think once I wrap my > head around how to do this, I'll be rolling through Django like it's > building sprites on a Commodore 64. > > So, I have four tables. Book, Publisher, Author

Display Data From Multiple Tables

2009-07-01 Thread The Danny Bos
Hi there, Seems easy, but I'm having an ass of a time. I think once I wrap my head around how to do this, I'll be rolling through Django like it's building sprites on a Commodore 64. So, I have four tables. Book, Publisher, Author and Review. A classic scenario. I want to display a loop on the h