Ignore:
Timestamp:
13 Feb 2011, 12:20:24 (14 years ago)
Author:
uli
Message:

Move more interfaces, disable two views and make tests work again.

File:
1 edited

Legend:

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

    r5746 r5758  
    3131from waeup.sirp.interfaces import IWAeUPObject
    3232from waeup.sirp.applicants.jambtables.util import get_applicant_data
    33 from waeup.sirp.applicants.jambtables.interfaces import (
    34     IApplicant, IApplicantContainer, IApplicantPrincipal, IApplicantPDEEditData)
     33from waeup.sirp.applicants.interfaces import (
     34    IApplicant, IApplicantPrincipal, IApplicantPDEEditData)
    3535from waeup.sirp.widgets.passportwidget import (
    3636    PassportWidget, PassportDisplayWidget
     
    3939from zope.formlib.sequencewidget import ListSequenceWidget, SequenceDisplayWidget
    4040from zope.formlib.widget import CustomWidgetFactory
    41 from waeup.sirp.applicants.jambtables.applicants import ResultEntry
     41from waeup.sirp.applicants import ResultEntry
    4242from waeup.sirp.widgets.objectwidget import (
    4343    WAeUPObjectWidget, WAeUPObjectDisplayWidget)
     
    6363    MultiListDisplayWidget, subwidget=results_display_widget)
    6464
    65 class ApplicationsPage(WAeUPPage):
    66     grok.context(IApplicantContainer)
    67     grok.name('index')
    68     title = 'Applications'
    69     pnav = 1
    70    
    71     def getApplications(self):
    72         """Get a list of all stored applications.
    73         """
    74         for key, val in self.context.items():
    75             url = self.url(val)
    76             yield(dict(url=url, name=key))
    77 
    78 class AddApplicant(WAeUPAddFormPage):
    79     grok.context(IApplicantContainer)
    80     grok.name('add')
    81     form_fields = grok.AutoFields(IApplicant)
    82     form_fields['fst_sit_results'].custom_widget = list_results_widget
    83     form_fields['passport'].custom_widget = EncodingImageFileWidget
    84     label = 'Add Applicant'
    85     title = 'Add Applicant'
    86     pnav = 1
    87 
    88     @grok.action('Add applicant')
    89     def addApplicant(self, **data):
    90         from waeup.sirp.jambtables.applicants import Applicant
    91         applicant = Applicant()
    92         self.applyData(applicant, **data)
    93         # XXX: temporarily disabled.
    94         #self.context[applicant.reg_no] = applicant
    95         try:
    96             self.context[applicant.access_code] = applicant
    97         except KeyError:
    98             self.flash('The given access code is already in use!')
    99             return
    100         self.redirect(self.url(self.context))
     65#class ApplicationsPage(WAeUPPage):
     66#    grok.context(IApplicantContainer)
     67#    grok.name('index')
     68#    title = 'Applications'
     69#    pnav = 1
     70#   
     71#    def getApplications(self):
     72#        """Get a list of all stored applications.
     73#        """
     74#        for key, val in self.context.items():
     75#            url = self.url(val)
     76#            yield(dict(url=url, name=key))
     77
     78#class AddApplicant(WAeUPAddFormPage):
     79#    grok.context(IApplicantContainer)
     80#    grok.name('add')
     81#    form_fields = grok.AutoFields(IApplicant)
     82#    form_fields['fst_sit_results'].custom_widget = list_results_widget
     83#    form_fields['passport'].custom_widget = EncodingImageFileWidget
     84#    label = 'Add Applicant'
     85#    title = 'Add Applicant'
     86#    pnav = 1
     87#
     88#    @grok.action('Add applicant')
     89#    def addApplicant(self, **data):
     90#        from waeup.sirp.jambtables.applicants import Applicant
     91#        applicant = Applicant()
     92#        self.applyData(applicant, **data)
     93#        # XXX: temporarily disabled.
     94#        #self.context[applicant.reg_no] = applicant
     95#        try:
     96#            self.context[applicant.access_code] = applicant
     97#        except KeyError:
     98#            self.flash('The given access code is already in use!')
     99#            return
     100#        self.redirect(self.url(self.context))
    101101
    102102class DisplayApplicant(WAeUPDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.