Document class, CMFTypes implementation.

This commit is contained in:
david 2002-11-11 06:39:54 +00:00
parent 91c41866c2
commit 6c2acbc318
2 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,46 @@
from AccessControl import ClassSecurityInfo
from Products.Lampadas import registerType
from Products.CMFTypes.BaseContent import BaseContent
from Products.CMFTypes.ExtensibleMetadata import ExtensibleMetadata
from Products.CMFTypes.Field import *
from Products.CMFTypes.Form import *
from Products.CMFTypes.debug import log
def addLampadasDocument(self, id, **kwargs):
o = LampadasDocument(id, **kwargs)
self._setObject(id, o)
class LampadasDocument(BaseContent):
"""A Lampadas-enabled Document type."""
portal_type = "Lampadas Document"
meta_type = "LampadasDocument"
type = BaseContent.type + FieldList((
Field('teaser',
searchable=1,
form_info=TextAreaInfo(description="A short lead-in to the article so that we might get people to read the body",
label="Teaser",
rows=3)),
Field('author'),
Field('body',
required=1,
searchable=1,
allowable_content_types=('text/plain', 'text/structured', 'text/html', 'application/msword'),
form_info=RichFormInfo(description="Enter a valid body for this document. This is what you will see",
label="Body Text",
)),
IntegerField("number", form_info=IntegerInfo(), default=42),
Field('image', form_info=FileInfo()),
# SlotField("about",
# form_info=SlotInfo(slot_metal="here/about_slot/macros/aboutBox",
# )),
))
registerType(LampadasDocument)

View File

@ -1,3 +1,2 @@
import DDocument
import Fact
import Document
#import DFolder