Back to index

plone3  3.1.7
person.py
Go to the documentation of this file.
00001 from Products.Archetypes.public import *
00002 
00003 class Person(BaseContent):
00004 
00005     schema = BaseSchema + Schema((
00006         ReferenceField('parents',
00007                        relationship='my_parents',
00008                        multiValued=True),
00009         ReferenceField('children',
00010                        relationship='my_children',
00011                        multiValued=True),
00012         ReferenceField('father',
00013                        relationship='my_father',
00014                        multiValued=False,
00015                        required=False),
00016         ReferenceField('mother',
00017                        relationship='my_mother',
00018                        multiValued=False,
00019                        required=False),
00020         LinesField('food_preference',
00021                    accessor='getFoodPrefs',
00022                    mutator='setFoodPrefs'),
00023         ))
00024 
00025 registerType(Person, 'tests.Marshall')