Changeset 6770


Ignore:
Timestamp:
14 Sep 2011, 13:43:34 (13 years ago)
Author:
Henrik Bettermann
Message:

Reorder class definitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6769 r6770  
    617617        return self.view.url(self.view.context, self.target)
    618618
    619 class StudentClearanceEditActionButton(ManageActionButton):
    620     grok.order(1)
    621     grok.context(IStudent)
    622     grok.view(StudentClearanceDisplayFormPage)
    623     grok.require('waeup.handleStudent')
    624     text = 'Edit'
    625     target = 'cedit'
    626 
    627     @property
    628     def target_url(self):
    629         if self.context.clearance_locked:
    630             return ''
    631         return self.view.url(self.view.context, self.target)
    632 
    633 class StudentClearanceEditFormPage(StudentClearanceManageFormPage):
    634     """ View to edit student clearance data by student
    635     """
    636     grok.context(IStudent)
    637     grok.name('cedit')
    638     grok.require('waeup.handleStudent')
    639     form_fields = grok.AutoFields(
    640         IStudentClearanceEdit).omit('clearance_locked')
    641     label = 'Edit clearance data'
    642     title = 'Clearance Data'
    643     pnav = 4
    644     form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    645 
    646     def emitLockMessage(self):
    647         self.flash('The requested form is locked (read-only).')
    648         self.redirect(self.url(self.context))
    649         return
    650 
    651     def update(self):
    652         if self.context.clearance_locked:
    653             self.emitLockMessage()
    654             return
    655         datepicker.need()
    656         return super(StudentClearanceEditFormPage, self).update()
    657 
    658     @grok.action('Save')
    659     def save(self, **data):
    660         self.applyData(self.context, **data)
    661         self.flash('Form has been saved.')
    662         return
    663 
    664     @grok.action('Save and request clearance')
    665     def requestclearance(self, **data):
    666         self.applyData(self.context, **data)
    667         self.context._p_changed = True
    668         #if self.dataNotComplete():
    669         #    self.flash(self.dataNotComplete())
    670         #    return
    671         self.redirect(self.url(self.context,'request_clearance'))
    672         return
    673 
    674619class StartClearance(WAeUPPage):
    675620    grok.context(IStudent)
     
    711656        return
    712657
     658class StudentClearanceEditActionButton(ManageActionButton):
     659    grok.order(1)
     660    grok.context(IStudent)
     661    grok.view(StudentClearanceDisplayFormPage)
     662    grok.require('waeup.handleStudent')
     663    text = 'Edit'
     664    target = 'cedit'
     665
     666    @property
     667    def target_url(self):
     668        if self.context.clearance_locked:
     669            return ''
     670        return self.view.url(self.view.context, self.target)
     671
     672class StudentClearanceEditFormPage(StudentClearanceManageFormPage):
     673    """ View to edit student clearance data by student
     674    """
     675    grok.context(IStudent)
     676    grok.name('cedit')
     677    grok.require('waeup.handleStudent')
     678    form_fields = grok.AutoFields(
     679        IStudentClearanceEdit).omit('clearance_locked')
     680    label = 'Edit clearance data'
     681    title = 'Clearance Data'
     682    pnav = 4
     683    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
     684
     685    def emitLockMessage(self):
     686        self.flash('The requested form is locked (read-only).')
     687        self.redirect(self.url(self.context))
     688        return
     689
     690    def update(self):
     691        if self.context.clearance_locked:
     692            self.emitLockMessage()
     693            return
     694        datepicker.need()
     695        return super(StudentClearanceEditFormPage, self).update()
     696
     697    @grok.action('Save')
     698    def save(self, **data):
     699        self.applyData(self.context, **data)
     700        self.flash('Form has been saved.')
     701        return
     702
     703    @grok.action('Save and request clearance')
     704    def requestclearance(self, **data):
     705        self.applyData(self.context, **data)
     706        self.context._p_changed = True
     707        #if self.dataNotComplete():
     708        #    self.flash(self.dataNotComplete())
     709        #    return
     710        self.redirect(self.url(self.context,'request_clearance'))
     711        return
     712
    713713class RequestClearance(WAeUPPage):
    714714    grok.context(IStudent)
Note: See TracChangeset for help on using the changeset viewer.