Sorry, my bad... who would have thought a simple list wouldn't work
with that filter.

I've looked at the source then saw your ticket.

Example tests:
list1 = ['item1']
list2 = ['item1', 'item2']
list3 = [['item1',[]], ['item2', []]]
list4 = ['item1', ['item2', []]]
list5 = [['item1', ['subitem1', 'subitem2',]], ['item2',
['subitem2',]]]

With your patch I still had issues with single elements (list1) and
list5 would render ['item1', ['subitem1', 'subitem2',] as text in the
first li then render correctly the rest.

I could come up with something like:

        def _helper(value, tabs):
                indent = '\t' * tabs
                if type(value) is type([]):
                        l = len(value)
                        if l == 0:
                                return ''
                        elif l == 1:
                                return('%s<li>%s</li>' % (indent, value[0]))
                        elif l == 2 and type(value[0]) is not type([]) and 
type(value[1]) is
type([]) and value[1]:
                                        return 
'%s<li>%s\n%s<ul>\n%s\n%s</ul>\n%s</li>' % (indent,
value[0], indent,
                                                '\n'.join([_helper(v, tabs+1) 
for v in value[1]]), indent,
indent)
                        else:
                                return '\n'.join([_helper(v, tabs) for v in 
value])
                else:
                        return('%s<li>%s</li>' % (indent, value))


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

Reply via email to