Re: Template help, gotta be simple

2008-02-03 Thread rex
it *should* be in the view anyway??? it's logic... but it should be possible? Something like this would work... although.. it's hideously innefficient. {% for row in data %} {% for key,val in row.items %} {% for field in fields %} {% ifequal field key %} {{ key }}: {{ val }} {% endifequal %} {% e

Re: Template help, gotta be simple

2008-02-02 Thread Ned Batchelder
I'm not sure there's a way to do this purely in the template language. You can munge the data in the view instead. This line creates a new filtered_data list that has only the data you want to display: filtered_data = [ dict([ (k,d[k]) for k in fields ]) for d in data ] --Ned. http://nedbatc