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), (733049, 0.0), (733077, 6313.83), (733084, 6370.96), (733091, 150.0), (733104, -500.0), (733107, 0.0), (733108, 500.0), (733133, 5967.62), (733154, 7054.0), (733164, 0.0), (733174, 5698.18), (733195, 0.0), (733212, 5469.15), (733224, 0.0), (733255, 4887.2), (733265, -70000.0), (733286, 0.0), (733316, 0.0), (733342, -119.78999999999999), (733349, 0.0), (733377, 0.0), (733409, 0.0), (733422, -241.0), (733426, 241.0), (733440, 0.0), (733468, 0.0), (733498, 0.0), (733531, 0.0), (733559, 0.0), (733582, 104.59), (733589, 0.0), (733622, 0.0), (733651, 0.0), (733671, 3315.0), (733681, 0.0), (733713, 0.0), (733742, 0.0), (733772, -83.89), (733776, 0.0), (733777, 0.0), (733804, 0.0), (733832, 0.0), (733863, 0.0), (733895, 0.0), (733924, 0.0), (733948, 4.33), (733954, 0.0), (733986, 0.0), (734016, 0.0), (734046, 0.0), (734053, 0.0), (734077, 0.0), (734107, 0.0), (734137, -35.65), (734169, 0.0), (734197, 0.0), (734228, 0.0), (734260, 0.0), (734289, 0.0), (734319, 0.0), (734350, 0.0), (734381, 0.0), (734413, 0.0), (734442, 0.0), (734472, 0.0), (734501, -31.380000000000003), (734505, 0.0), (734534, 0.0), (734563, 0.0), (734595, 0.0), (734625, 0.0), (734655, 0.0), (734686, 0.0), (734716, 0.0), (734749, 0.0), (734777, 0.0), (734808, 0.0), (734840, 0.0), (734868, 0.0), (734900, 0.0), (734931, 0.0), (734960, 0.0), (734990, 3455.0), (735022, 1030.0), (735050, -2099.0), (735081, 460.0), (735113, -102.0), (735142, -980.0), (735173, 1538.9), (735204, 920.0), (735231, -500.0), (735233, 0.0), (735267, -1000.0), (735295, -1150.0), (735325, -250.0), (735355, 0.0), (735386, -560.69), (735415, 570.0), (735446, 0.0), (735477, -300.0), (735507, -205.70999999999998), (735540, 1600.0), (735569, -1040.0), (735598, -1404.31), (735614, 8.62), (735631, 0.0), (735649, 0.0), (735659, 0.0), (735689, 5.0), (735722, 0.0), (735750, 135.0), (735780, 770.0), (735813, 265.0), (735842, -1165.0), (735872, 30.0), (735904, -55.0), (735933, 4.29), (735967, 1105.0), (735968, 0.0), (735990, 4.32), (735995, 0.0), (736024, 0.0), (736055, 0.0), (736087, -1000.0), (736116, 0.0), (736146, 0.0), (736178, 0.0), (736208, 185.0), (736240, -285.68), (736269, 0.0), (736299, 0.0), (736332, 44.32), (736361, 0.0), (736389, 0.0), (736422, 0.0), (736451, -40.0), (736481, 0.0)] On Tue, Jun 13, 2017 at 5:33 PM, ludovic coues <cou...@gmail.com> wrote: > 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" <suab...@gmail.com> wrote: > >> Hi, >> I need some help, i am using Django as my web framework and sqlalchemy to >> query my database. When i pass data template its not showing on the >> template. can someone point me to the right direction. >> >> The post date is loaded on the template but the Net Balance is not >> loaded. Don't know what i am doing wrong here. >> >> below is my view.py and template >> >> >> view.py >> >> def SUMCORP(request): >> engine=create_engine('mssql+pymssql://username:pass@servername >> /RBVData') >> connection=engine.connect() >> metadata=MetaData() >> fund=Table('gltrxdet',metadata,autoload=True,autoload_with=engine) >> stmt=select([fund.columns.date_posted,func.sum(fund.columns. >> nat_balance)]) >> stmt = stmt.where(fund.columns.account_code=='002CORP') >> stmt=stmt.group_by(fund.columns.date_posted) >> results=connection.execute(stmt).fetchall() >> return render_to_response('fundmanager_sum.html',locals()) >> >> >> template.html >> >> <table class="table table-striped"> >> <thead> >> <tr> >> >> <th>Net Balance</th> >> <th>Post Date</th> >> </thead> >> >> </tr> >> {%for a in results%} >> >> <tr> >> >> <td>{{a.nat_balance}}</td> >> <td>{{a.date_posted}}</td> >> >> </tr> >> >> {%endfor%} >> </table> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/django-users/CAPCf-y7tGoLm2hxPaQpBrrm_j0VJvTF1UvE%3D- >> vQgbjh%3DzCxEMg%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAPCf-y7tGoLm2hxPaQpBrrm_j0VJvTF1UvE%3D-vQgbjh%3DzCxEMg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/CAEuG%2BTYqadry9dT8O2R0XQcivXae2OGWY > aA%2BoefTmO4wL22DCQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAEuG%2BTYqadry9dT8O2R0XQcivXae2OGWYaA%2BoefTmO4wL22DCQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optou > <https://groups.google.com/d/optout> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPCf-y48Ayx0jkhRj9dPXs9UF6YAN2Znrf64htgHr9YAo9EWLw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.