Re: problem with passing dict object to django template

2008-09-02 Thread Matt Berg
Bruno and David, Thanks. I greatly appreciate the help. You're right. I should include this in the model and have it handled by a class. Right now I'm just focused on figuring out the mechanics of django. Again, thank you very much for taking the time to explain this. Matt On Sep 2, 3:06 pm,

Re: problem with passing dict object to django template

2008-09-02 Thread bruno desthuilliers
On 2 sep, 20:22, Matt Berg <[EMAIL PROTECTED]> wrote: > Sorry. > > Yes, in the template I do a loop... > > for crop in crops Where do "crops" come from ? In your above code, you only returned the ci dict, no t crops. > In the view, I make an array ci (cropinfo). It's actually a dict, not an arr

Re: problem with passing dict object to django template

2008-09-02 Thread bruno desthuilliers
On 2 sep, 19:34, Matt Berg <[EMAIL PROTECTED]> wrote: > Still new to django and python and have been struggling with the > following. > > Basically, I want to pass the following dict object to a django > template. > > def crop_info(season,crops): > ci = {} > cd = {} Since you rebind cd

Re: problem with passing dict object to django template

2008-09-02 Thread Matt Berg
Sorry. Yes, in the template I do a loop... for crop in crops In the view, I make an array ci (cropinfo). Each ci I append a new dict object (cd) which is associated with the crop id. In the template, I just want to loop through the crops and then display items in the embedded dict that are ti

Re: problem with passing dict object to django template

2008-09-02 Thread David Zhou
On Sep 2, 2008, at 1:34 PM, Matt Berg wrote: > In my template, I want to be able to iterate through the crops with > info like this: > > {{ ci.[crop.id].total }} Are you using this within another loop? Where's crop.id coming from? --- David Zhou [EMAIL PROTECTED] --~--~-~--~---