> ./manage.py shell >>> from django.template.defaultfilters import random >>> l = [ 1, 2, 3, 4 ] >>> random( l ) 2 >>> random( l ) 1 >>> random( l ) 4 >>> random( l ) 2 >>> random( l ) 2 >>> random( l ) 3
In template context behaviour is the same. On 3 янв, 19:09, "jt.wang" <[EMAIL PROTECTED]> wrote: > hi , > we can see > > "random > > Returns a random item from the > list."fromhttp://www.djangoproject.com/documentation/templates/.butit is > diffcult > to understand without examples. > so,is there anyone who can give me an example about "random" of Built-in > filter reference in templates? > > thanks! > > wjtbox01.vcf > 1KЗагрузить --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---