Hi,

I need to limit the number of elements I have to display on an index page.

Right now I do something like this in the template.

{% for p in part.object.all %}
...
{% endfor %}

Witch obliviously output all objects in the set.
In the view, I can do it this way:

Part.objects.all()[:5]

I would like to do this without doing the actual query in the view, am I
missing something ?

thanks

Alexandre Forget

--~--~---------~--~----~------------~-------~--~----~
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