[Zope-CMF] need to create new content type based on python
Jim Pharis
jpharis@rtl.org
24 Jul 2002 10:11:37 -0400
I speak from experience. I attempted to create 2 new portal_types called
Project and Task. Project was to be a folder with a few added attributes
such as creator and date. Task was to be a description of some task with
attributes of its own.
I started by copying PortalFolder.py and other files from CMFCore into
my own folder. I spent about 2 weeks hacking code and got fairly far.
However, I finally came to the realization that creating new portal_type
has a few issues that are complicated to overcome.
1. You are creating a product to sit on top of another product.
2. CMF needs additions to it. So you will end up modifying CMF itself to
appease your new product.
3. Upkeep of this new product will be horrendous and will include
modifications to your product and to CMF each time it needs to be done.
I found that creating a new portal_types isn't as hard as I thought. It
can be done by copying an existing portal_type that will be similar to
your new product. For example for Project I copied Folder. Then by
customizing portal_skins to display the portal_type properly.
If you still insist on creating a new portal_type with py then copy the
files that relate most closely to your new type. That should give you a
decent start.
On Wed, 2002-07-24 at 08:44, Jeffrey_Franks@i-o.com wrote:
>
>
> Hi,
>
> I need a new content type for a special kind of portal_file
> object.
>
> I've just determined that the specification I've been given is
> fuzzy, i.e., likely to change/evolve and so I don't think this
> is a good fit for ZClass.
>
> However, another Zope learning curve challenge presents
> itself for me -- programming a content type in python.
>
> If I could find an existing zope product or content type
> that is python based, and it subclasses from 'portal_file',
> I could use that as a model for what I need to do.
>
> Does anyone know of one of these that I can learn from and
> modify?
>
> or
>
> Is there some other object that is close enough that I can
> use as a model?
>
> -- jlf
>
>
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests