Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries
On Fri, Sep 7, 2012 at 6:19 PM, Tim Chase
<django.users@tim.thechases.com> 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 post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home