Re: How to Display 2 items of an Object

2007-05-21 Thread robo
Great ideas! Thanks Kelvin. I'll definitely try it out and post the results here, robo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googleg

Re: How to Display 2 items of an Object

2007-05-20 Thread Kelvin Nicholson
robo wrote: > I assume you guys also know python. If so, I wish to get some help > with this implementation: > What I want to return is a new variable each time through the for > loop: > If I am understanding this correctly, take a look at setattr() You would have to do something like this, I t

Re: How to Display 2 items of an Object

2007-05-19 Thread robo
I assume you guys also know python. If so, I wish to get some help with this implementation: What I want to return is a new variable each time through the for loop: catQuantity = len(categoryList) for x in catQuantity: cat(x) = get_object_or_404(Category, cat_order=x) return cat(x) Thi

Re: How to Display 2 items of an Object

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 00:29 -0700, robo wrote: > Hi Kelvin, > > > You could limit the list from the query ... Model.objects.all()[:2] > > I have tried Project.objects.all()[:3] in hopes that the 3rd time > through the loop, it would show the "see more ..." link. But what this > actually gives me

Re: How to Display 2 items of an Object

2007-05-18 Thread robo
Hi Kelvin, > You could limit the list from the query ... Model.objects.all()[:2] I have tried Project.objects.all()[:3] in hopes that the 3rd time through the loop, it would show the "see more ..." link. But what this actually gives me is the first 3 projects, not 3 projects for each category. H

Re: How to Display 2 items of an Object

2007-05-18 Thread Kelvin Nicholson
Hey Robo: You could limit the list from the query ... Model.objects.all()[:2] But I think the easiest way would be using the slice tag inside the template. {{ some_list|slice:":2" }} Tried these methods yet? Kelvin robo wrote: > Hi everyone, I've set up my code to display a page that shows

How to Display 2 items of an Object

2007-05-17 Thread robo
Hi everyone, I've set up my code to display a page that shows all categories and projects belonging to each category. Pseudo code like so: for category in category for project in project ifequal project.category_id category.id {{project.title}} endifequal endfor endfor Right no