Create an archetype content type with Paster and ZopeSkel

ZopeSkel provides a collection of skeletons for quickstarting Zope and Plone projects. These skeletons are available as PasteScript templates and can be used via the "paster" command line tool. This how-to describes how-to create a plone egg with an archetype content type in a fiew command lines.

1. Install ZopeSkel

$ easy_install -U ZopeSkel

2. Create the archetype Plone egg

$ paster create --list-template
Available templates:
      archetype: A Plone project that uses Archetypes

$ paster create -t archetype
Enter project name: myproject.contenttypes

3. Create the content-type

$ cd myproject.contenttypes
$ paster addcontent --list
Available templates:
       contenttype:  A content type skeleton
$ paster addcontent contenttype
Enter contenttype_name (Content type name ) ['Example Type']: MyContentType

4. Add an archetype field to the new content-type

$ paster addcontent --list
Available templates:
    atschema: A handy AT schema builder
$ paster addcontent atschema
Enter content_class_filename (What is the module (file)name of your content class?) 
['exampletype']: mycontenttype
Enter field_name (What would you like to name this field?) ['newfield']: myfield
Enter field_type (What kind of field should I make for you?
Some examples: [computed,cmfobject,reference,text,image,float,lines,datetime,boolean,
file,integer,fixedpoint,string]) ['string']:
Enter widget_type (What kind of widget do you want to use 
(example: Password)?) ['default']:

5. Links

6. Thanks

Thank you to Jean-Michel François aka toutpt who introduced me to this very handy tool, and of course to the authors of PasteScript and ZopeSkel!

Posté par David le 07:37
Many thanks; it's pretty straight forward in itself but certainly is handy to see what options are coming up for schema etc.
Posté par Dan Thomas le 06:37
This worked for me in Windows, and this may be useful to others:
1) after cd to my product, I had to run paster with "..\paster"
2) I could install the product by doing this from the product folder: "..\..\python.exe install"
3) The message about Cheetah can apparently be ignored.

Thanks for a great write-up.
Ajouter un commentaire

Vous pouvez ajouter un commentaire en complétant le formulaire ci-dessous. Le format doit être plain text. Les commentaires sont modérés.

Question: 2 x nine =
Votre réponse: