Poll App tutorial question

2016-12-11 Thread Matthew Schroeder
In part 5 of the Django Poll App tutorial there was a "Vote Again" function, how do you access the next question.id, instead of the current one? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

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

Re: Django tutorial question

2012-10-06 Thread TJ Marbois
Ah ok thanks was just curious as to why it was still lingering if it wasn't used in the example. just a tiny bit confusing but all still worked! - thanks for the reply. Tj On Sunday, October 7, 2012 12:26:12 AM UTC-4, Lee Hinde wrote: > > TJ Marbois wrote: > > Hi > > going thru the Djang

Re: Django tutorial question

2012-10-06 Thread Lee Hinde
TJ Marbois wrote: Hi going thru the Django tutorial - and got to this part: https://docs.djangoproject.com/en/1.4/intro/tutorial03/#decoupling-the-urlconfs my editor has a python lint program running...and it complains about 'include' at the import being written but unused... is there any r

Django tutorial question

2012-10-06 Thread TJ Marbois
Hi going thru the Django tutorial - and got to this part: https://docs.djangoproject.com/en/1.4/intro/tutorial03/#decoupling-the-urlconfs my editor has a python lint program running...and it complains about 'include' at the import being written but unused... is there any reason this is left in

Re: Tutorial question

2012-07-19 Thread Thomas Orozco
A model is just a class, so the methods just "go there", yes. You could check out apps in django.contrib for styling best practices (the django doc itself also covers this I think*,* but I can't remember where) Le 17 juil. 2012 19:49, "jeffsarge" a écrit : > Hi, > I'm learning Django and Python

Re: Tutorial question

2012-07-17 Thread Tomas Neme
> Do these just get stuck onto the end of my class Poll(models.Model):? like > this... Yes, that's right perhaps you should start here: http://docs.python.org/tutorial/classes.html you should probably at least be comfortable enough with python to know how to define classes before diving into dj

Re: Tutorial question

2012-07-17 Thread Kurtis Mullins
Hey Jeff, Yes, these methods would go inside of your Poll Class. I'm not sure if the indentation was messed up through e-mail, but make sure that your method body is indented one step deeper than your method signature. For example: class Poll(...): # def __unicode__(self): ret

Re: Tutorial question

2012-07-17 Thread Jonathan Baker
Yes, the methods are part of your model class. You almost have it right, and just need to fix your indentations: class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.question def was

Tutorial question

2012-07-17 Thread jeffsarge
Hi, I'm learning Django and Python at the same time. Going through the Django tutorial (writing your first Django app) Going smooth until I hit the part where I need to add a unicode method to both Poll and Choice: def __unicode__(self): return self.question same with the custom methods th

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Brandy
Yep..that's it. Thanks! On Apr 11, 12:55 pm, Jonathan Baker wrote: > The method should begin and end with two underscores: __unicode__(self): > > > > > > On Wed, Apr 11, 2012 at 11:30 AM, Brandy wrote: > > I am working through the tutorial and have already added the def > > _unicode_ statements

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Gerald Klein
Have you resynced? On Wed, Apr 11, 2012 at 12:30 PM, Brandy wrote: > I am working through the tutorial and have already added the def > _unicode_ statements to my code. However, when running > Poll.objects.all(), I still get this output: [] > > Here is the code: > > from django.db import models

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Babatunde Akinyanmi
I don't know if its because I'm reading this mail from my phone but you should have __unicode__() not _unicode_() ie is 2 underscores before and after not 1 On 4/11/12, Brandy wrote: > I am working through the tutorial and have already added the def > _unicode_ statements to my code. However, wh

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Jonathan Baker
The method should begin and end with two underscores: __unicode__(self): On Wed, Apr 11, 2012 at 11:30 AM, Brandy wrote: > I am working through the tutorial and have already added the def > _unicode_ statements to my code. However, when running > Poll.objects.all(), I still get this output: [] >

Tutorial question regarding def _unicode_

2012-04-11 Thread Brandy
I am working through the tutorial and have already added the def _unicode_ statements to my code. However, when running Poll.objects.all(), I still get this output: [] Here is the code: from django.db import models class Poll(models.Model): question = models.CharField(max_length=200)

Re: Quick tutorial question

2012-04-11 Thread Mark Phillips
Check the bottom of tutorial #1 - Wait a minute. is, utterly, an unhelpful representation of this object. Let's fix that by editing the polls model (in the polls/models.py file) and adding a __unicode__()

Quick tutorial question

2012-04-11 Thread oneroler
I'm working through the tutorial and was setting up the admin site for the polls app. I noticed in the "Select Poll to Change" section that it was showing "poll object" rather than "what's up" or the question associated with the poll. Same is true on the Choice area of admin, the dropdown for

Re: Newbie Tutorial Question Part 4

2009-05-01 Thread arfinsd
Got it, shouldn't be hitting /polls Since we put in the object_id Alex On May 1, 8:57 am, arfinsd wrote: > Have a newbie question. I'm stuck on the tutorial and keep getting a > 404 error when I try to hit:http://127.0.0.1:8000/polls > > My files are listed below, does anyone see something tha

Newbie Tutorial Question Part 4

2009-05-01 Thread arfinsd
Have a newbie question. I'm stuck on the tutorial and keep getting a 404 error when I try to hit: http://127.0.0.1:8000/polls My files are listed below, does anyone see something that I'm doing wrong? URLS.py #-- # Uncomment the next two lines to enable the admin

Re: polls tutorial question

2008-11-14 Thread John M
What you see is what you get when it comes to templates in the Tutorial. There is no default CSS or anything like that. If you'd like to do CSS from a media file, you'll have to check the docs on serving static files via the builtin server. J On Nov 14, 12:19 pm, prem1er <[EMAIL PROTECTED]> wr

polls tutorial question

2008-11-14 Thread prem1er
Trying to mess with the styling of the polls view from the tutorial. Where is it reading it's CSS from? Or where is it 'extending' its style from. I tried to incorporate a CSS sheet from within that directory and it wouldn't read it. It would only read HTML that I placed in the document itself.

Re: tutorial question

2008-04-11 Thread Erik Vorhes
Using a database doesn't by default make your site searchable. It's a more efficient storage system (usually) than having a bunch of static files. SQLite is an easy way to develop, especially if you're running Python 2.5, but I usually move to a PostgreSQL backend for "production" sites, since SQ

Re: tutorial question

2008-04-11 Thread sebey
you make a good point i will say but I have a few reasons for this: 1.I try and keep things easy 2. I don't want them to be searchable(I know that sound odd but I my site is designed so that I do not have the need for search 3. I don't really want to add another thing to my "to learn list" as wel

Re: tutorial question

2008-04-11 Thread James Bennett
On Fri, Apr 11, 2008 at 5:20 AM, sebey <[EMAIL PROTECTED]> wrote: > i am on a mac and I am running a podcasting network so I will proabley > be storing all my files in XML/RSS I think you're suffering from very severe conceptual confusion. Take a podcast and think about it logically: Each pod

Re: tutorial question

2008-04-11 Thread sebey
i am on a mac and I am running a podcasting network so I will proabley be storing all my files in XML/RSS On Apr 11, 11:11 am, Brett Parker <[EMAIL PROTECTED]> wrote: > On 11 Apr 01:35, sebey wrote: > > > > > I see that in page 1 of the django tutorial in the django docs it sets > > you up with a

Re: tutorial question

2008-04-11 Thread Brett Parker
On 11 Apr 01:35, sebey wrote: > > I see that in page 1 of the django tutorial in the django docs it sets > you up with a database > > can you skip this or is the a very easy way to get a database setup > and then uninstaill or is the another tutorial that you can learn > without a database neede

tutorial question

2008-04-11 Thread sebey
I see that in page 1 of the django tutorial in the django docs it sets you up with a database can you skip this or is the a very easy way to get a database setup and then uninstaill or is the another tutorial that you can learn without a database needed? --~--~-~--~~~-

Re: [OT] Vim (was "Poll tutorial question")

2007-04-20 Thread Brett Parker
On Thu, Apr 19, 2007 at 06:23:45PM -0400, Jay Parlar wrote: > > On 4/19/07, Tim Chase <[EMAIL PROTECTED]> wrote: > > > > >> Well, whitespaces in Python are pretty difficult to keep in > > >> line, if you are used to other languages. I personally use > > >> Tabs for intending and VIM editor and ha

Re: [OT] Vim (was "Poll tutorial question")

2007-04-19 Thread Jay Parlar
On 4/19/07, Tim Chase <[EMAIL PROTECTED]> wrote: > > >> Well, whitespaces in Python are pretty difficult to keep in > >> line, if you are used to other languages. I personally use > >> Tabs for intending and VIM editor and have it to make Tabs > >> visible like dark blue |--, > > > > Hey, do y

Re: [OT] Vim (was "Poll tutorial question")

2007-04-19 Thread Tim Chase
>> Well, whitespaces in Python are pretty difficult to keep in >> line, if you are used to other languages. I personally use >> Tabs for intending and VIM editor and have it to make Tabs >> visible like dark blue |--, > > Hey, do you mind sharing your .vimrc for that, probably best > on dpast

Re: Poll tutorial question

2007-04-19 Thread Michael K
On Mar 29, 9:03 am, Gilhad <[EMAIL PROTECTED]> wrote: > On Wednesday 28 March 2007 11:50, wheresdave wrote: > > > got it fixed. Whitespace was showing up before pass. found the setting > > in scite to show whitespace. > > Well, whitespaces in Python are pretty difficult to keep in line, if you are

Re: Poll tutorial question

2007-04-19 Thread Oliver Rühl
Thanks. This also fixed it for me. Guess what: I'm new to Python :-) On 29 Mrz., 15:03, Gilhad <[EMAIL PROTECTED]> wrote: > On Wednesday 28 March 2007 11:50, wheresdave wrote: > > > got it fixed. Whitespace was showing up before pass. found the setting > > in scite to show whitespace. > > Well, w

Re: Poll tutorial question

2007-03-29 Thread Gilhad
On Wednesday 28 March 2007 11:50, wheresdave wrote: > got it fixed. Whitespace was showing up before pass. found the setting > in scite to show whitespace. Well, whitespaces in Python are pretty difficult to keep in line, if you are used to other languages. I personally use Tabs for intending an

Re: Poll tutorial question

2007-03-28 Thread wheresdave
got it fixed. Whitespace was showing up before pass. found the setting in scite to show whitespace. On Mar 28, 2:47 am, "wheresdave" <[EMAIL PROTECTED]> wrote: > Thank you for the prompt reply, unfortunately that is not the case. > Sorry for the not checking spacing before I posted. the class doe

Re: Poll tutorial question

2007-03-28 Thread wheresdave
Thank you for the prompt reply, unfortunately that is not the case. Sorry for the not checking spacing before I posted. the class does line up with question in my editor (scite). For something that is supposed to be so easy to learn, this basic tutorial sure is frusterating. On Mar 28, 2:32 am,

Re: Poll tutorial question

2007-03-28 Thread Gilhad
On Wednesday 28 March 2007 10:47, wheresdave wrote: > On the second page where you add the polls to the admin section. > Already added in the polls and the settings.py file, and logged into > admin, so admin does work. > > When i added admin into the models.py file per tutorial it does not > show

Poll tutorial question

2007-03-28 Thread wheresdave
On the second page where you add the polls to the admin section. Already added in the polls and the settings.py file, and logged into admin, so admin does work. When i added admin into the models.py file per tutorial it does not show up on the admin screen. tried logging in an out, clear cache et