Changeset 5948
- Timestamp:
- 14 Apr 2011, 21:25:35 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r5946 r5948 862 862 grok.require('waeup.manageUniversity') 863 863 grok.name('add') 864 form_fields = grok.AutoFields(IFaculty)865 864 label = '' 866 865 title = 'Add faculty' 867 866 pnav = 1 867 868 # We need a deepcopy here, because otherwise also all other 869 # IFaculty forms would be affected. 870 form_fields = copy.deepcopy(grok.AutoFields(IFaculty)) 871 form_fields.get('code').field.readonly = False 868 872 869 873 @grok.action('Add faculty') … … 923 927 grok.name('add') 924 928 grok.require('waeup.manageUniversity') 925 form_fields = grok.AutoFields(IDepartment)926 929 title = 'Add department' 927 930 label = '' 928 931 pnav = 1 932 933 # We need a deepcopy here, because otherwise also all other 934 # IDepartment forms would be affected. 935 form_fields = copy.deepcopy(grok.AutoFields(IDepartment)) 936 form_fields.get('code').field.readonly = False 929 937 930 938 @grok.action('Add department') … … 954 962 grok.name('manage') 955 963 grok.require('waeup.manageUniversity') 964 title = 'Edit faculty' 965 pnav = 1 966 956 967 form_fields = grok.AutoFields(IFaculty) 957 title = 'Edit faculty'958 pnav = 1959 968 960 969 @grok.action('Save') … … 1082 1091 title = u'Add certificate' 1083 1092 pnav = 1 1084 form_fields = grok.AutoFields(ICertificate) 1085 1093 1094 # We need a deepcopy here, because otherwise also all other 1095 # ICertificate forms would be affected. 1096 form_fields = copy.deepcopy(grok.AutoFields(ICertificate)) 1097 form_fields.get('code').field.readonly = False 1098 1086 1099 @grok.action('Add certificate') 1087 1100 def addCertificate(self, **data): … … 1220 1233 grok.name('manage') 1221 1234 grok.require('waeup.manageUniversity') 1222 # We omit 'code' field from original schema and set prepend a new 1223 # one with 'readonly' set to True. 1224 form_fields = grok.Fields( 1225 code = schema.TextLine( 1226 title = u'Code', readonly=True 1227 ) 1228 ) + grok.AutoFields(ICertificate).omit('code') 1229 pnav = 1 1235 pnav = 1 1236 1237 form_fields = grok.AutoFields(ICertificate) 1230 1238 1231 1239 @property -
main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py
r5944 r5948 30 30 """Representation of a university faculty. 31 31 """ 32 code = schema.TextLine( 33 title = u'Code', 34 description = u'Abbreviated code of the faculty', 35 default = u'NA', 36 required = True, 37 readonly = True, 38 ) 39 32 40 title = schema.TextLine( 33 41 title = u'Name of Faculty', … … 42 50 ) 43 51 44 code = schema.TextLine(45 title = u'Code',46 description = u'Abbreviated code of the faculty',47 default = u'NA',48 required = True,49 )50 51 52 class IFacultyContainer(IWAeUPContainer): 52 53 """A container for faculties. … … 60 61 """Representation of a department. 61 62 """ 63 code = schema.TextLine( 64 title = u'Code', 65 default = u'NA', 66 description = u'Abbreviated code of the department', 67 required = True, 68 readonly = True, 69 ) 70 62 71 title = schema.TextLine( 63 72 title = u'Name of Department', … … 69 78 title = u'Title prefix', 70 79 default = u'department', 71 required = True,72 )73 74 code = schema.TextLine(75 title = u'Code',76 default = u'NA',77 description = u'Abbreviated code of the department',78 80 required = True, 79 81 ) … … 139 141 description = u'Abbreviated code of the certificate.', 140 142 required = True, 143 readonly = True, 141 144 ) 142 145 143 146 review_state = schema.Choice( 144 title = u' review state',147 title = u'Review State', 145 148 default = 'unchecked', 146 149 values = ['unchecked', 'checked'] … … 148 151 149 152 title = schema.TextLine( 150 title = u' title',153 title = u'Title', 151 154 required = True, 152 155 ) 153 156 154 157 study_mode = schema.TextLine( 155 title = u' study mode',158 title = u'Study Mode', 156 159 required = True, 157 160 ) 158 161 159 162 start_level = schema.TextLine( 160 title = u' start level',163 title = u'Start Level', 161 164 required = True, 162 165 ) 163 166 164 167 end_level = schema.TextLine( 165 title = u' end level',168 title = u'End Level', 166 169 required = True, 167 170 ) 168 171 169 172 application_category = schema.TextLine( 170 title = u'a pplication category',173 title = u'aApplication Category', 171 174 required = False, 172 ) 173 174 max_pass = schema.TextLine( 175 title = u'maximum pass', 176 required = False, 177 ) 178 175 ) 179 176 180 177
Note: See TracChangeset for help on using the changeset viewer.