source: waeup_product/trunk/Student.py @ 32

Last change on this file since 32 was 19, checked in by joachim, 19 years ago

initial import

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1from Globals import InitializeClass
2from AccessControl import ClassSecurityInfo
3
4from Products.CMFCore.utils import getToolByName
5from Products.CMFCore.permissions import View
6from Products.CMFCore.permissions import ModifyPortalContent
7from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder
8from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument
9#from Products.CMFCore.PortalContent import PortalContent
10#from Products.CMFCore.PortalFolder import PortalFolder
11#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
12
13#from Products.CMFCore.interfaces.Contentish import Contentish as IContentish
14#from Products.CMFCore.interfaces.Dynamic import DynamicType as IDynamicType
15from Products.CPSDocument.CPSDocument import CPSDocument
16
17factory_type_information = (
18    {'id': 'Student',
19     'meta_type': 'Student',
20     'description': 'The WAeUP Student',
21     'title': 'WAeUP Student',
22     'icon': 'student.gif',
23     'product': 'WAeUP',
24     'factory': 'addStudent',
25     'immediate_view': 'student_edit_form',
26     'filter_content_types': 1,
27     'allowed_content_types': ('JAMB'),
28     'allow_discussion': 0,
29     'actions': ({'id': 'view',
30                  'name': 'View',
31                  'action': 'student_view',
32                  'permissions': (View,)},
33                 {'id': 'addJamb',
34                  'name': 'new JAMB',
35                  'action': 'folder_factories',
36                  'permissions': (ModifyPortalContent,)},
37                 {'id': 'edit',
38                  'name': 'Edit',
39                  'action': 'student_edit_form',
40                  'permissions': (ModifyPortalContent,)},
41                 ),
42     # additionnal cps stuff
43      'cps_display_as_document_in_listing' : 1,
44     },
45    )
46
47class Student(BaseDocument):
48    """
49    WAeUP Student container for the various student data
50    """
51##    meta_type = 'Student'
52##    portal_type = meta_type
53##    security = ClassSecurityInfo()
54
55##    _properties = BaseDocument._properties + (
56##        {'id': 'jamb_is_admitted', 'type': 'boolean'},
57##        {'id': 'jamb_where_admitted', 'type': 'string'},
58##        )
59
60##    allow_discussion = 0
61##    jamb_is_admitted = False
62##    jamb_where_admitted = ''
63   
64   
65InitializeClass(Student)
66
67def addStudent(container, id, REQUEST=None, **kw):
68    """Add a Student."""
69    ob = Student(id, **kw)
70    return CPSBase_adder(container, ob, REQUEST=REQUEST)
Note: See TracBrowser for help on using the repository browser.