Ignore:
Timestamp:
2 Nov 2005, 14:40:07 (19 years ago)
Author:
joachim
Message:

=migrate + editing of folders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Students.py

    r91 r139  
    3939    'allowed_content_types': ('Jamb','StudentPersonal'),
    4040    'allow_discussion': False,
    41 ##    'actions': (
    42 ##         {'id': 'view',
    43 ##          'name': 'action_view',
    44 ##          'action': 'string:${object_url}/student_index_html',
    45 ##          #'action': 'string:${object_url}/cpsdocument_view',
    46 ##          'condition': '',
    47 ##          'permission': ('View',),
    48 ##          'category': 'object',
    49 ##          'visible': True,},
    50 ##         {'id': 'new_content',
    51 ##          'name': 'Add Data',
    52 ##          'action': 'string:${object_url}/folder_factories',
    53 ##          'condition': "python:1 or len(object.contentItems()) == 0 ",
    54 ##          'permission': ('Modify portal content',),
    55 ##          'category': 'object',
    56 ##          'visible': True,},
    57 ##         {'id': 'contents',
    58 ##          'name': 'action_folder_contents',
    59 ##          'action': 'string:${object_url}/folder_contents',
    60 ##          'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
    61 ##          'permission': ('Modify portal content',),
    62 ##          'category': 'object',
    63 ##          'visible': True,},
    64 ##         {'id': 'edit',
    65 ##          'name': 'action_edit',
    66 ##          'action': 'string:${object_url}/cpsdocument_edit_form',
    67 ##          'condition': '',
    68 ##          'permission': ('Modify portal content',),
    69 ##          'category': 'object',
    70 ##          'visible': True,},
    71 ##    )
    7241}
    7342
     
    8251    security = ClassSecurityInfo()
    8352   
     53    security.declareProtected(View,"getTitle")
     54    def getTitle(self):
     55        """compose title"""
     56        content = self.PERSONAL.getContent()
     57        return "%s %s" % (content.firstname,content.lastname)
     58       
    8459InitializeClass(Student)
    8560
     
    10277    'allowed_content_types': (),
    10378    'allow_discussion': False,
    104 ##    'actions': (
    105 ##         {'id': 'view',
    106 ##          'name': 'action_view',
    107 ##          'action': 'string:${object_url}/student_index_html',
    108 ##          #'action': 'string:${object_url}/cpsdocument_view',
    109 ##          'condition': '',
    110 ##          'permission': ('View',),
    111 ##          'category': 'object',
    112 ##          'visible': True,},
    113 ##         {'id': 'new_content',
    114 ##          'name': 'Add Data',
    115 ##          'action': 'string:${object_url}/folder_factories',
    116 ##          'condition': "python:1 or len(object.contentItems()) == 0 ",
    117 ##          'permission': ('Modify portal content',),
    118 ##          'category': 'object',
    119 ##          'visible': True,},
    120 ##         {'id': 'contents',
    121 ##          'name': 'action_folder_contents',
    122 ##          'action': 'string:${object_url}/folder_contents',
    123 ##          'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
    124 ##          'permission': ('Modify portal content',),
    125 ##          'category': 'object',
    126 ##          'visible': True,},
    127 ##         {'id': 'edit',
    128 ##          'name': 'action_edit',
    129 ##          'action': 'string:${object_url}/cpsdocument_edit_form',
    130 ##          'condition': '',
    131 ##          'permission': ('Modify portal content',),
    132 ##          'category': 'object',
    133 ##          'visible': True,},
    134 ##    )
    13579}
    13680
     
    165109    'allowed_content_types': ('Course',),
    166110    'allow_discussion': False,
    167 ##    'actions': (
    168 ##         {'id': 'view',
    169 ##          'name': 'action_view',
    170 ##          'action': 'string:${object_url}/jamb_index_html',
    171 ##          'condition': '',
    172 ##          'permission': ('View',),
    173 ##          'category': 'object',
    174 ##          'visible': True,},
    175 ##         {'id': 'new_content',
    176 ##          'name': 'Add Data',
    177 ##          'action': 'string:${object_url}/folder_factories',
    178 ##          'condition': "python:1 or len(object.contentItems()) == 0 ",
    179 ##          'permission': ('Modify portal content',),
    180 ##          'category': 'object',
    181 ##          'visible': True,},
    182 ##         {'id': 'contents',
    183 ##          'name': 'action_folder_contents',
    184 ##          'action': 'string:${object_url}/folder_contents',
    185 ##          'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
    186 ##          'permission': ('Modify portal content',),
    187 ##          'category': 'object',
    188 ##          'visible': True,},
    189 ##         {'id': 'edit',
    190 ##          'name': 'action_edit',
    191 ##          'action': 'string:${object_url}/cpsdocument_edit_form',
    192 ##          'condition': '',
    193 ##          'permission': ('Modify portal content',),
    194 ##          'category': 'object',
    195 ##          'visible': True,},
    196 ##    )
    197111}
    198112###)
     
    214128###)
    215129
     130study_level_fti = { ###(
     131    'title': 'WAeUP StudyLevel',
     132    'description': '',
     133    'content_icon': '',
     134    'content_meta_type': 'StudyLevel',
     135    'factory': 'addStudyLevel',
     136    'immediate_view': 'cpsdocument_view',
     137    'global_allow': True,
     138    'filter_content_types': True,
     139    'allowed_content_types': ('Course',),
     140    'allow_discussion': False,
     141}
     142###)
     143
     144class StudyLevel(CPSDocument): ###(
     145    """
     146    WAeUP StudyLevel containing the courses and students
     147    """
     148    meta_type = 'StudyLevel'
     149    portal_type = meta_type
     150    security = ClassSecurityInfo()
     151   
     152InitializeClass(StudyLevel)
     153
     154def addStudyLevel(container, id, REQUEST=None, **kw):
     155    """Add a StudyLevel."""
     156    ob = StudyLevel(id, **kw)
     157    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     158###)
     159
     160semester_fti = { ###(
     161    'title': 'WAeUP Semester',
     162    'description': '',
     163    'content_icon': '',
     164    'content_meta_type': 'Semester',
     165    'factory': 'addSemester',
     166    'immediate_view': 'cpsdocument_view',
     167    'global_allow': True,
     168    'filter_content_types': True,
     169    'allowed_content_types': ('Course',),
     170    'allow_discussion': False,
     171}
     172###)
     173
     174class Semester(CPSDocument): ###(
     175    """
     176    WAeUP Semester containing the courses and students
     177    """
     178    meta_type = 'Semester'
     179    portal_type = meta_type
     180    security = ClassSecurityInfo()
     181   
     182InitializeClass(Semester)
     183
     184def addSemester(container, id, REQUEST=None, **kw):
     185    """Add a Semester."""
     186    ob = Semester(id, **kw)
     187    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     188###)
     189
Note: See TracChangeset for help on using the changeset viewer.