Hello,
I'm new to Django and I've only a medium background in funtionnal
programming in Python.

I'm currently reading and working on the Django tutorial. I've few
questions on a example of code because things are not so clear for me.

Here is the code example

1 from django.db import models
2
3 class Person(models.Model):
4     first_name = models.CharField(max_length=30)
5     last_name = models.CharField(max_length=30)

Can you say me if I'm wrong or not on the followings:

- line 1 : Import of the" models" method from the "django.db"
module ?

- line 3 : Définition of the "Person" classs wich heritates from the
"models.Model class ? If true, and assuming that "models" is a method,
a class can be nested in a method ?

- ligne 4 : Creation of variable "first_name" by calling the method
CharField with one argument. But how "CharFiled" is written, isn't it
a class ? ANd here we use only "models", then why on line 3 we use
"models.Model" ?

I hope it's not to much confusing !!!! :-)

Help would be REALLY appreciated !!!

Regards

Alain

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to