Re: passing data to template

2017-06-15 Thread Mike Dewhirst
On 16/06/2017 12:12 PM, sum abiut wrote: Is it possible to pass data from two different django functions to a one template in a single for loop? Yes. The general way to do that (and pretty much all Django things) is to write a "view" which can contain as many functions as desired and fetch as

Re: passing data to template

2017-06-14 Thread sum abiut
Hi Mike, Thank heaps for direction. Appreciate your help. Cheers, On Thu, Jun 15, 2017 at 1:52 PM, Mike Dewhirst wrote: > On 15/06/2017 12:07 PM, sum abiut wrote: > >> I try to perform a division on the tuple but i am getting an error. I >> have added another column call Gl rate. i try to perfo

Re: passing data to template

2017-06-14 Thread Mike Dewhirst
On 15/06/2017 12:07 PM, sum abiut wrote: I try to perform a division on the tuple but i am getting an error. I have added another column call Gl rate. i try to perform the division lin {{a.1/a.0}}but im geting an error. not sure what i am doing wrong here. You are asking the template to perfor

Re: passing data to template

2017-06-14 Thread sum abiut
I try to perform a division on the tuple but i am getting an error. I have added another column call Gl rate. i try to perform the division lin {{a.1/a.0}} but im geting an error. not sure what i am doing wrong here. Net Balance Post Date GL rate {%for a in results%} {{a.0}}

Re: passing data to template

2017-06-14 Thread sum abiut
Thanks heaps. appreciate your help, pointing me to right direction. On Thu, Jun 15, 2017 at 5:28 AM, ludovic coues wrote: > > > > Net Balance > Post Date > > > {%for a in results%} > > {{a.0}} > {{a.1}} > > {%endfor%} > > > `{{results|pprint}}` is pretty clear. You have a lis

Re: passing data to template

2017-06-14 Thread ludovic coues
Net Balance Post Date {%for a in results%} {{a.0}} {{a.1}} {%endfor%} `{{results|pprint}}` is pretty clear. You have a list of tuple. Tuples have no named member so a.nat_balance return a None value. {{ a.0 }} in your django template is the equivalent of a[0] in python. If you w

Re: passing data to template

2017-06-13 Thread sum abiut
Yes, on the database it spelt nat_balance On Wed, Jun 14, 2017 at 9:16 AM, Simon McConnell wrote: > {{a.nat_balance}} > > sure it shouldn't be spelt > > {{a.net_balance}} > > ? > > On Wednesday, 14 June 2017 06:57:30 UTC+10, suabiut wrote: >> >> Hi ludovic, >> Thanks for your response. >> when i

Re: passing data to template

2017-06-13 Thread Simon McConnell
{{a.nat_balance}} sure it shouldn't be spelt {{a.net_balance}} ? On Wednesday, 14 June 2017 06:57:30 UTC+10, suabiut wrote: > > Hi ludovic, > Thanks for your response. > when i did what you say it print out the date and sum in an array. Date > still in Julian date but i don't worry about the d

Re: passing data to template

2017-06-13 Thread sum abiut
Hi ludovic, Thanks for your response. when i did what you say it print out the date and sum in an array. Date still in Julian date but i don't worry about the date now just want to have the sum display nicely in my template [(733011, 28397.54), (733030, 5136.79), (733044, 35.89), (733048, 0.0), (7

Re: passing data to template

2017-06-12 Thread ludovic coues
Try `{{ results | pprint }}` in your template. That will not solve your problems but that will give you a lot more information about what data have been passed to your template. On 13 Jun 2017 6:53 am, "sum abiut" wrote: > Hi, > I need some help, i am using Django as my web framework and sqlalc