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 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 now I can display all categories and projects belong to each,
> but I want something like this to show:
> 
> Category 1                      project title 1
>                                       project title 2
>                                       see more projects ...
> 
> How can I stop displaying any more projects after 2 have been shown,
> then display a "see more projects ..." link?
> 
> 
> > 


-- 
Kelvin Nicholson
Voice: +886 9 52152 336
Voice: +1 503 715 5535
GPG Keyid: 27449C8C
Data: [EMAIL PROTECTED]
Skype: yj_kelvin
Site: http://www.kelvinism.com

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to