PythonistL wrote:

>I use SLICE filter. I t works ok, but when I try  e.g.
>
>{{ some_list|slice:":2" }}
>
>where some_list is
>some_list=[1,2,3,4]
>
>I will get [1, 2].
>
>Is it possible, via templates, to remove brackets?
>  
>
Yes. After "slice" you get back a Python list which is converted to 
string to appear on a page. Here you get brakets from default 
representation of a list in Python. You can convert a list to a string 
with "join" specifying what will be between items:

{{ some_list|slice:":2"|join:", " }}

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