- Timestamp:
- 16 Nov 2011, 11:12:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7114 r7117 275 275 grok.require('waeup.manageStudents') 276 276 mus = 1024 * 150 277 input_name = u'filename' 277 278 @property 279 def input_name(self): 280 return "%s" % self.__name__ 278 281 279 282 def update(self): 280 283 self.max_upload_size = string_from_bytes(self.mus) 281 delete_button = self.request.form.get('delete_%s' % self.input_name, None) 282 upload_button = self.request.form.get('upload_%s' % self.input_name, None) 284 delete_button = self.request.form.get( 285 'delete_%s' % self.input_name, None) 286 upload_button = self.request.form.get( 287 'upload_%s' % self.input_name, None) 283 288 if delete_button: 284 289 handle_file_delete( … … 296 301 self.view.redirect( 297 302 self.view.url(self.context, self.view.__name__)) 303 else: 304 self.view.flash('No local file selected.') 305 self.view.redirect( 306 self.view.url(self.context, self.view.__name__)) 298 307 return 299 308 … … 320 329 mus = 1024 * 50 321 330 download_name = u'passport.jpg' 322 input_name = u'passport'323 331 324 332 class PassportUploadEdit(PassportUploadManage): … … 335 343 download_name = u'birth_certificate.jpg' 336 344 337 class BirthCertificateUpload (FileUpload):345 class BirthCertificateUploadManage(FileUpload): 338 346 """Birth Certificate upload viewlet. 339 347 """ … … 342 350 mus = 1024 * 150 343 351 download_name = u'birth_certificate.jpg' 344 input_name = u'birth_certificate'345 352 346 353 class AcceptanceLetterDisplay(FileDisplay): … … 351 358 download_name = u'acceptance_letter.jpg' 352 359 353 class AcceptanceLetterUpload (FileUpload):360 class AcceptanceLetterUploadManage(FileUpload): 354 361 """AcceptanceLetter upload viewlet. 355 362 """ … … 358 365 mus = 1024 * 150 359 366 download_name = u'acceptance_letter.jpg' 360 input_name = u'acceptance_letter' 367 368 class BirthCertificateUploadEdit(BirthCertificateUploadManage): 369 """Birth Certificate upload viewlet for student. 370 """ 371 grok.require('waeup.handleStudent') 372 373 class AcceptanceLetterUploadEdit(AcceptanceLetterUploadManage): 374 """AcceptanceLetter upload viewlet for student. 375 """ 376 grok.require('waeup.handleStudent') 361 377 362 378 class Image(grok.View):
Note: See TracChangeset for help on using the changeset viewer.