Update of /cvsroot/plone-docs/Developers/Archetypes
In directory sc8-pr-cvs1:/tmp/cvs-serv18520
Modified Files:
getting_started.rst
Log Message:
added some missing S and added a comment about importing * similar to sydnei's zopemag article.
Index: getting_started.rst
===================================================================
RCS file: /cvsroot/plone-docs/Developers/Archetypes/getting_started.rst,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** getting_started.rst 14 Sep 2003 15:27:26 -0000 1.2
--- getting_started.rst 24 Oct 2003 22:28:58 -0000 1.3
***************
*** 97,104 ****
First we have to import two classes from our Product and Archetypes, respectively::
! from Permissions import ADD_CONTENT_PERMISSION
from Products.Archetypes.public import DisplayList
! ``ADD_CONTENT_PERMISSION`` refers to your Content Type permission for adding your type defined in ``Permissions.py``.
The second import is Displaylist, a data container we use when displaying pulldowns/radiobuttons/checkmarks with different choices. Let's say we wanted priorities on our instant messages, and we wanted those to be ``High``, ``Normal`` and ``Low``. We will specify these later in the file.
--- 97,104 ----
First we have to import two classes from our Product and Archetypes, respectively::
! from Permissions import ADD_CONTENTS_PERMISSION
from Products.Archetypes.public import DisplayList
! ``ADD_CONTENTS_PERMISSION`` refers to your Content Type permission for adding your type defined in ``Permissions.py``.
The second import is Displaylist, a data container we use when displaying pulldowns/radiobuttons/checkmarks with different choices. Let's say we wanted priorities on our instant messages, and we wanted those to be ``High``, ``Normal`` and ``Low``. We will specify these later in the file.
***************
*** 150,154 ****
from config import SKINS_DIR, GLOBALS, PROJECTNAME
! from config import ADD_CONTENT_PERMISSION
The next line registers the skins and global directories as File System Directory Views in the CMF::
--- 150,154 ----
from config import SKINS_DIR, GLOBALS, PROJECTNAME
! from config import ADD_CONTENTS_PERMISSION
The next line registers the skins and global directories as File System Directory Views in the CMF::
***************
*** 209,212 ****
--- 209,217 ----
from Products.Archetypes.public import BaseContent, registerType
+
+ You also can import all all the fields, widgets and classes made publicly available by Archetypes. Note that this is considered bad style by most Python programmers (importing * from a module), but this doesn't mean it can't be done and, of course, it makes life a lot easier: it makes a lot of stuff available to our module, although we are only going to use a small amount of it::
+
+ from Products.Archetypes.public import *
+
The ``registerType`` function is needed to initialize our content type later, so we import it here.
|