Alex Koshelev 写道: >> ./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Загрузить >> > > > > thank alex koshelev and tim chase, thank you very much.
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
begin:vcard fn:jt wang n:wang;jt email;internet:[EMAIL PROTECTED] note;quoted-printable:=E5=AD=A6=E4=BC=9A=E5=86=92=E6=B3=A1=E6=8B=89=E6=8E=A7=E4=BB=B6=EF=BC=8C=E8= =B5=B0=E9=81=8D=E5=A4=A9=E4=B8=8B=E9=83=BD=E4=B8=8D=E6=80=95 version:2.1 end:vcard