get() si no existe coincidencia te tira error asi de simple.
2014-07-24 11:41 GMT-03:00 Daniel Roseman <daniel@roseman.org.uk>:
On Thursday, 24 July 2014 13:53:54 UTC+1, Fabian Zentner wrote:Hey guys,<snip>
I'm new with Django and Python as well. I'm doing the tutorial 1 on the website (https://docs.djangoproject.com/en/1.6/intro/tutorial01/).
I'm using Python27 (C:\Python27)
In C:\Python27\Scripts\ I have the project mysite and polls like in the tutorial
In the part "Playing with the API"
>>> p.choice_set.all()
[<Choice: Choice object>, <Choice: Choice object>, <Choice: Choice object>, <Cho
ice: Choice object>, <Choice: Choice object>, <Choice: Choice object>]
>>> p.choice_set.count()
6
I get always Poll: Poll object or Choice: Choice object instead of the defined text. Also I have problems with the part of
p = Poll.objects.get(pk=1)
>>> p.was_published_recently()
Could somebody help me please? Before I start with the tutorial number 2...
Thanks a lot.
FabianAfter you make changes to the code, you need to reload it: the easiest way is exit your shell and go back in.--DR.--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d80dc547-6194-4398-81d9-e93db01ca9cf%40googlegroups.com.
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
------------------------------------------------------------
Ricardo Daniel Quiroga - L2Radamanthys
Msn: l2radamanthys@gmail.com
ricardo_quiu@hotmail.com
Email: l2radamanthys@gmail.com
l2radamanthys@saltalug.org.ar
ricardoquiroga.dev@gmail.com
sitio Web: http://www.l2radamanthys.com.ar
Facebook: http://es-la.facebook.com/L2Radamanthys
Twitter: @l2Radamanthys
---------------------------------------------------------
---------------------------------------------------------
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO2-wHZs4Zh2B2RgS%2BSfrDZLLHSUZ00tD37nFEFB-Ou1%3DB1swA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment