Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Class definition in the tutorial
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zeynel  
View profile  
 More options Nov 9, 3:00 am
From: Zeynel <azeyn...@gmail.com>
Date: Sun, 8 Nov 2009 08:00:56 -0800 (PST)
Local: Mon, Nov 9 2009 3:00 am
Subject: Class definition in the tutorial
I am just learning Object Oriented terminology as I go along. Please
help me to understand what each word means in the class definition in
the tutorial http://docs.djangoproject.com/en/dev/intro/tutorial01/ .
Thank you.

class => defines a class

Poll => name of the class? [my guess: this is just a name; it is not
used in the database?]

(models.Model): => what is this? [my guess: there is a django class
called model and that has a subclass called Model and this statement
says that Poll is a subcalls of Model which is subclass of model?]

question => the name of the class variable? [my guess: This is a
column in the database?]

models. => what is this?

.CharField(max_length=200) => [my guess: this defines the type of the
data in the column "question"]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Bennett  
View profile  
 More options Nov 9, 3:36 am
From: James Bennett <ubernost...@gmail.com>
Date: Sun, 8 Nov 2009 10:36:12 -0600
Local: Mon, Nov 9 2009 3:36 am
Subject: Re: Class definition in the tutorial

On Sun, Nov 8, 2009 at 10:00 AM, Zeynel <azeyn...@gmail.com> wrote:
> I am just learning Object Oriented terminology as I go along. Please
> help me to understand what each word means in the class definition in
> the tutorial http://docs.djangoproject.com/en/dev/intro/tutorial01/ .

You may experience better results from doing a Python tutorial first,
to teach you the basic information about programming that you'll need
to work with Django.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gonzalo Delgado  
View profile  
 More options Nov 9, 3:48 am
From: Gonzalo Delgado <gonzalodelg...@fortix.com.ar>
Date: Sun, 8 Nov 2009 13:48:32 -0300
Local: Mon, Nov 9 2009 3:48 am
Subject: Re: Class definition in the tutorial

El Sun, 8 Nov 2009 08:00:56 -0800 (PST)
Zeynel <azeyn...@gmail.com> escribió:

> I am just learning Object Oriented terminology as I go along.

Not the best idea if you ask me. You should try "wetting your feet" with
simpler stuff first, and reading OOP theory.
That being said, I *guess* you can start out and do a lot of stuff with Django
without giving much thought of object oriented stuff.

Anyway, I'll give you some pointers for your questions:

> Please help me to understand what each word means in the class definition in
> the tutorial http://docs.djangoproject.com/en/dev/intro/tutorial01/ .
> Thank you.

> class => defines a class

http://docs.python.org/tutorial/classes.html

> Poll => name of the class? [my guess: this is just a name; it is not
> used in the database?]

Name of the class the example is defining. Django creates a table in the
database wich includes the name "poll" prefixed by the app's name.

> (models.Model): => what is this? [my guess: there is a django class
> called model and that has a subclass called Model and this statement
> says that Poll is a subcalls of Model which is subclass of model?]

Your guess is close, but not quite correct. 'model' is the name of a module
(a .py file containing code), read about that here:
http://docs.python.org/tutorial/modules.html
The rest of your guess is correct       :)

> question => the name of the class variable? [my guess: This is a
> column in the database?]

Your guess is somewhat correct, there will be a column in a database named
"question" as a result from that line of code.
A class variable is something Django uses to make this happen.

> models. => what is this?

A Python module.

> .CharField(max_length=200) => [my guess: this defines the type of the
> data in the column "question"]

Yup, more on that here:
http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fi...

Good luck!

--
P.U. Gonzalo Delgado <gonzalodelg...@fortix.com.ar>
http://gonzalodelgado.com.ar/

  application_pgp-signature_part
< 1K Download

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google