Ignore:
Timestamp:
13 Nov 2014, 13:21:59 (10 years ago)
Author:
Henrik Bettermann
Message:

Enucleation. Keep only the portal's framework. Remove university, students, applicants, hostels and accesscodes modules.

Location:
main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils/batching.py

    r11849 r11947  
    338338                obj = self.callFactory()
    339339                # Override all values in row, also
    340                 # student_ids and applicant_ids which have been
     340                # customer ids which have been
    341341                # generated in the respective __init__ methods before.
    342342                self.updateEntry(obj, row, site, base)
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils/browser.py

    r9127 r11947  
    2626
    2727from waeup.kofa.interfaces import IUniversity
    28 
    29 def replaceStudentMessages(old, new):
    30     students = grok.getSite()['students']
    31     for student in students.values():
    32         history = IObjectHistory(student)
    33         history.modifyMessages(old, new)
    34     return
    35 
    36 def replaceApplicantMessages(old, new):
    37     applicants = grok.getSite()['applicants']
    38     for container in applicants.values():
    39         for applicant in container.values():
    40             history = IObjectHistory(applicant)
    41             history.modifyMessages(old, new)
    42     return
    43 
    44 def removeStudentMessage(student_id, number):
    45     students = grok.getSite()['students']
    46     student = students.get(student_id, None)
    47     if student:
    48         history = IObjectHistory(student)
    49         success, text = history.removeMessage(number)
    50     return success, text
    51 
    52 def removeApplicantMessage(applicant_id, number):
    53     applicants = grok.getSite()['applicants']
    54     try:
    55         container, application_number = applicant_id.split('_')
    56     except:
    57         return False, 'applicant_id is wrong'
    58     container = applicants.get(container, None)
    59     if not container:
    60         return False, 'No such container'
    61     applicant = container.get(application_number, None)
    62     if applicant is None:
    63         return False, 'No such applicant'
    64     history = IObjectHistory(applicant)
    65     success, text = history.removeMessage(number)
    66     return success, text
    6728
    6829class ReindexPage(UtilityView, grok.View):
     
    9556        self.redirect(self.url(self.context, '@@index'))
    9657        return
    97 
    98 class ModifyAllStudentHistory(UtilityView, grok.View):
    99     """ View to modify all student histories.
    100 
    101     """
    102     grok.context(IUniversity)
    103     grok.name('modify_student_history')
    104     grok.require('waeup.managePortal')
    105 
    106     def update(self,old=None, new=None):
    107         if None in (old, new):
    108             self.flash('Syntax: /modify_student_history?old=[old string]&new=[new string]')
    109             return
    110         replaceStudentMessages(old, new)
    111         self.context.logger.info(
    112             "'%s' replaced by '%s' in all student histories." % (old, new))
    113         self.flash('Finished')
    114         return
    115 
    116     def render(self):
    117         self.redirect(self.url(self.context, '@@index'))
    118         return
    119 
    120 class RemoveStudentHistoryMessage(UtilityView, grok.View):
    121     """ View to remove a single student history entry.
    122 
    123     """
    124     grok.context(IUniversity)
    125     grok.name('remove_student_history_message')
    126     grok.require('waeup.managePortal')
    127 
    128     def update(self,student_id=None, number=None):
    129         if None in (student_id, number):
    130             self.flash('Syntax: /remove_student_history_message?student_id=[id]&number=[line number, starting with 0]')
    131             return
    132         try:
    133             number=int(number)
    134         except:
    135             self.flash('Error')
    136             return
    137         success, text = removeStudentMessage(student_id, number)
    138         if not success:
    139             self.flash('Error: %s' % text)
    140             return
    141         self.context.logger.info(
    142             "line '%s' removed in %s history" % (text, student_id))
    143         self.flash('Finished')
    144         return
    145 
    146     def render(self):
    147         self.redirect(self.url(self.context, '@@index'))
    148         return
    149 
    150 class ModifyAllApplicantHistory(UtilityView, grok.View):
    151     """ View to modify all student histories.
    152 
    153     """
    154     grok.context(IUniversity)
    155     grok.name('modify_applicant_history')
    156     grok.require('waeup.managePortal')
    157 
    158     def update(self,old=None, new=None):
    159         if None in (old, new):
    160             self.flash('Syntax: /modify_applicant_history?old=[old string]&new=[new string]')
    161             return
    162         replaceApplicantMessages(old, new)
    163         self.context.logger.info(
    164             "'%s' replaced by '%s' in all applicant histories." % (old, new))
    165         self.flash('Finished')
    166         return
    167 
    168     def render(self):
    169         self.redirect(self.url(self.context, '@@index'))
    170         return
    171 
    172 class RemoveApplicantHistoryMessage(UtilityView, grok.View):
    173     """ View to remove a single applicant history entry.
    174 
    175     """
    176     grok.context(IUniversity)
    177     grok.name('remove_applicant_history_message')
    178     grok.require('waeup.managePortal')
    179 
    180     def update(self,applicant_id=None, number=None):
    181         if None in (applicant_id, number):
    182             self.flash('Syntax: /remove_applicant_history_message?applicant_id=[id]&number=[line number, starting with 0]')
    183             return
    184         try:
    185             number=int(number)
    186         except:
    187             self.flash('Error')
    188             return
    189         success, text = removeApplicantMessage(applicant_id, number)
    190         if not success:
    191             self.flash('Error: %s' % text)
    192             return
    193         self.context.logger.info(
    194             "line '%s' removed in %s history" % (text, applicant_id))
    195         self.flash('Finished')
    196         return
    197 
    198     def render(self):
    199         self.redirect(self.url(self.context, '@@index'))
    200         return
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils/helpers.py

    r11824 r11947  
    235235    grok.name(u'waeup.Factory')
    236236    title = u"Create instances of ``factory``.",
    237     description = u"This factory instantiates new applicant instances."
     237    description = u"This factory instantiates new e.g. applicant instances."
    238238    factory = None
    239239
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils/tests/test_converters.py

    r8216 r11947  
    3838    DELETION_MARKER, IGNORE_MARKER)
    3939from waeup.kofa.schoolgrades import ResultEntryField
    40 from waeup.kofa.university import Faculty
    4140from waeup.kofa.utils.converters import (
    4241    IObjectConverter, IFieldConverter, DefaultFieldConverter,
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/utils/utils.py

    r11821 r11947  
    258258        """Send credentials as email.
    259259
    260         Input is the applicant for which credentials are sent and the
     260        Input is the customer for which credentials are sent and the
    261261        password.
    262262
Note: See TracChangeset for help on using the changeset viewer.