Re: Writing your first Django app - Tutorial Question

2013-06-25 Thread Tony Guilin
> > you have missed > from django.utils import timezone > That worked! Thanks. P.S. I just copy and paste in Chrome (in Ubuntu) and it picks up the formatting. On Tuesday, June 4, 2013 4:10:23 PM UTC-7, Tony Guilin wrote: > > In the https://docs.djangoproject.com/en/1.5/intro/tutorial01

Re: Writing your first Django app - Tutorial Question

2013-06-05 Thread Sergiy Khohlov
you have missed from django.utils import timezone Also simple question : How are you adding this nice code formatting ? Many thanks, Serge +380 636150445 skype: skhohlov On Wed, Jun 5, 2013 at 7:48 AM, Mike Dewhirst wrote: > On 5/06/2013 9:10am, Tony Guilin wrote: > >> In the >> ht

Re: Writing your first Django app - Tutorial Question

2013-06-04 Thread Mike Dewhirst
On 5/06/2013 9:10am, Tony Guilin wrote: In the https://docs.djangoproject.com/en/1.5/intro/tutorial01/ tutorial under the, Playing with the API section, I'm trying to go through the example in my python shell as described. p = Poll(question="What's new?", pub_date=timezone.now()) But

Writing your first Django app - Tutorial Question

2013-06-04 Thread Tony Guilin
In the https://docs.djangoproject.com/en/1.5/intro/tutorial01/ tutorial under the, Playing with the API section, I'm trying to go through the example in my python shell as described. p = Poll(question="What's new?", pub_date=timezone.now()) But I'm unable to get to next command "p.save()" b

Re: "Writing your first Django app" Tutorial Question

2012-10-12 Thread Tomáš Ehrlich
Hi Stefano, your understanding is incorrect. Django (neither Python) doesn't load (or import) anything by himself. Everything what you import is everything what you get. There are few exceptions, like Python builtin module (and default tags/templates in Django templates), but that's definitely n

Re: "Writing your first Django app" Tutorial Question

2012-10-12 Thread Jan Bednařík
Hi, model Choice is related to model Poll by ForeignKey. All Choice objects related to specific Poll object can by returned by: my_poll.choice_set.all() And that is happening in the template in for loop: {% for choice in poll.choice_set.all %} ... More detailed info is here: https://docs.djang

Re: "Writing your first Django app" Tutorial Question

2012-10-12 Thread Jason Sibre
Hi Rick, I'll try to explain, but it's really more about Python than Django... (I'm not familiar with the tutorial app, so I'm basing my answers on what code you copied into your email.) That import of Poll that you see in details.py doesn't even enter into it. It's only used on the line that

"Writing your first Django app" Tutorial Question

2012-10-12 Thread Rick Chong
Hi, I have just started learning programming and I am following the creating a poll app tutorial at: https://docs.djangoproject.com/en/1.4/intro/tutorial03/ I hope that someone has attempted this tutorial and is able to help me on some very beginner questions: In this app, we defined 2 classes