Re: I want Develop django poll app tuturial

2011-04-01 Thread cha
thank you very much mr-gladys for this effort this is view def results(request, poll_id): p = get_object_or_404(Poll, pk=poll_id) choices = p.choice_set.all() total_poll_votes = sum(c.votes for c in choices) percentage = {} for choice in choices: vote = choice.votes

Re: I want Develop django poll app tuturial

2011-04-01 Thread gladys
For easy reference, models are pasted below. from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(m

Re: I want Develop django poll app tuturial

2011-04-01 Thread creecode
April Fools joke right? :-) HA HA LOL! On Apr 1, 1:00 am, cha wrote: > Im waiting Toodle-l.. creecode -- 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 unsu

Re: I want Develop django poll app tuturial

2011-04-01 Thread cha
ok .. i know it's the amount of votes for option how can I get it in python -- 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 djang

Re: I want Develop django poll app tuturial

2011-04-01 Thread Kenneth Gonsalves
On Fri, 2011-04-01 at 01:00 -0700, cha wrote: > Im waiting for what? -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: I want Develop django poll app tuturial

2011-04-01 Thread Robbington
Wow thats rude, poll_votes = the amount of votes for option a/b/c/d etc. On Apr 1, 9:00 am, cha wrote: > Im waiting -- 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 unsubsc

Re: I want Develop django poll app tuturial

2011-04-01 Thread cha
Im waiting -- 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+unsubscr...@googlegroups.com. For more options, visit thi

Re: I want Develop django poll app tuturial

2011-03-31 Thread cha
thanx I have Reached the following total_poll_votes = sum(c.votes for c in p.choice_set.all()) poll_votes = ?? vote_percentage = (poll_votes/total_poll_votes)*100 i just need poll_votes -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: I want Develop django poll app tuturial

2011-03-31 Thread Sithembewena Lloyd Dube
^^ This would apply per poll. On Thu, Mar 31, 2011 at 4:50 PM, Sithembewena Lloyd Dube wrote: > Hi there, > > I think that you would need to get the count of votes for each poll, add > all votes and use the formula: > > vote_percentage = (poll_votes/total_poll_votes)*100 > > > > On Thu, Mar 31, 2

Re: I want Develop django poll app tuturial

2011-03-31 Thread Sithembewena Lloyd Dube
Hi there, I think that you would need to get the count of votes for each poll, add all votes and use the formula: vote_percentage = (poll_votes/total_poll_votes)*100 On Thu, Mar 31, 2011 at 8:33 AM, cha wrote: > ok in beginning > how i can get percentage for each vote ? > > this result code >

Re: I want Develop django poll app tuturial

2011-03-30 Thread cha
ok in beginning how i can get percentage for each vote ? this result code def results(request, poll_id): p = get_object_or_404(Poll, pk=poll_id) return render_to_response('polls/results.html', {'poll': p}) -- You received this message because you are subscribed to the Google Groups