Hi guys, thank you for your responses. I think, following your advice, I'll have to abandon my attempts to handle this in the template, and sort this out in the views instead.
Thanks again :) J On Saturday, September 8, 2012 7:40:39 PM UTC+1, Javier Guerra wrote: > > On Fri, Sep 7, 2012 at 6:19 PM, Tim Chase > <django...@tim.thechases.com <javascript:>> wrote: > > On 09/07/12 16:06, Jason Whatford wrote: > >> P.s. Tim, my data structure isn't that malleable. It's > >> essentially I query my appengine datastore, and that retrieves a > >> list of the data models, each of which can be treated as a dict. > >> The dicts are used in a few different ways in the view - only > >> this is giving me trouble though. > > > > Ah, but the transformations I suggest can be done within your view > > before passing it to your template. > > it's the only sensible way. > > you wouldn't put the database access code in the template, right? > similarly, there's no need to deal with less-than-optimal structures > in the template. the view code is the appropriate place to gather all > relevant data, transform it to a presentation-friendly format and pass > to the template just for rendering. > > > -- > Javier > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/6exFRIVwG6oJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.