On Tue, Nov 18, 2008 at 1:54 PM, Ross Dakin <[EMAIL PROTECTED]> wrote:
>
>> Others already gave you practical answers, so this will be mostly a
>> more general ('conceptual' ?) advice: don't mix heterogenous data
>> (objects, whatever) in a list. If you have a compelling reason (ie :
>> ordering) to have heterogenous data, wrap them all in a same 'meta'
>> data structure.
>
> Agreed. The simplest solution might be to just wrap your single
> objects in dictionaries:
>
> my_list = [
>                {single_object},
>                {'one', 'two'},
>                {single_object},
>                {'one', 'two'},
>                ]

That's basically what Alex was doing.  The issue was how to render
different front-end code given that a single list has different
'types' of renderings.

My way put that logic into me template, but ideally, as Bruno said,
each 'type' should be able to dispatch its own specific render.

-- 
---
David Zhou
[EMAIL PROTECTED]

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