On Thu, Jul 3, 2008 at 10:21 AM, antony_h <[EMAIL PROTECTED]> wrote: > > How could I repeat my <div> 20 times? > I've found how I can repeat it 5 times: > {% for a in 12345|make_list %} > <div> > {% endfor %} > But it's not so great for e.g. a hundred > Usage: my designer wants to test his layout and I don't want to create > a custom tag for such a simple task >
You could probably use a generic view for this pretty easily, just pass in a list with 20 elements in it. Something like : list = range(0,20) url( r'^test/$', 'django.views.generic.simple.direct_to_template', {'template': 'test.html', 'extra_context': { 'list':list } } ), See generic views documentation: http://www.djangoproject.com/documentation/generic_views/#django-views-generic-simple-direct-to-template The django templating language is purposely dumbed down so the work is done in the view according to the model-view-template pattern. -- Milan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---