I have:
Enter code here...from django.shortcuts import render
from django.template import RequestContext, loader
from django.http import HttpResponse
from polls.models import Poll
def index(request):
latest_poll_list = Poll.objects.get(name="Test")
#Poll.objects.all().order_by('-pub_date')[
>
> It currently shows a list of the polls, what I am trying to work out is
> how to print out the integer value that is associated with that pole.
Is poll.id what you want? In the template it would be {{ poll.id }}
Or: Poll.objects.get(name="Test").id
--
You received this message because yo
On Saturday, 2 August 2014 12:55:25 UTC+10, Collin Anderson wrote:
>
> It currently shows a list of the polls, what I am trying to work out is
>> how to print out the integer value that is associated with that pole.
>
>
> Is poll.id what you want? In the template it would be {{ poll.id }}
>
> Or
What does the error say?
--
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-u
FieldError at /polls/
Cannot resolve keyword 'name' into field. Choices are: choice, id, pub_date,
question
Request Method:G
Maybe try:
Poll.objects.get(question="Test")
--
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, s
Perhaps you should show your model definition and the complete traceback.
A wild guess though, did you syncdb?
On 2 Aug 2014 20:23, "Michael Carey" wrote:
> FieldError at /polls/
>
> Cannot resolve keyword 'name' into field. Choices are: choice, id, pub_date,
> question
>
>
>
>
>
>
>
>
>
>
>
>
7 matches
Mail list logo