On 5/14/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:

On Sun, 2006-05-14 at 15:13 +0530, Amit Upadhyay wrote:
> Lets say I have a Author and Article models, related via many to many.
> On the profile view of authors I want to show the articles they
> contributed to, but not all of them. The number is purely a decision
> of the designer, how does one do a limit/offset in template?

Django supplies a slice filter. So {{article_list|slice:":5"}} will do
what you want.

This will happen before or after database has been hit?



--
Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay
+91-9867-359-701
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to