On Mon, Nov 17, 2008 at 10:45 AM, Alex Jonsson <[EMAIL PROTECTED]> wrote:
> So the question is: how do I check (in the template) if the object
> that is being run in the for loop is a dictionary, so that I in turn
> can run a for loop on it? Or is there a better way of doing this other
> than mixing objects and dictionaries in the list?
What about making it a list of tuples, and including a type?
{'articles': [('single', <Article: This is another biggie>),
('multiple', {1: <Article: Single split>, 2: <Article: Split B>}),
('single', <Article: Big B>)]}
Then you could just do a {% for type, article in articles %}, and have
a conditional on the type.
--
---
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---