Ignore:
Timestamp:
26 Nov 2011, 06:49:16 (13 years ago)
Author:
Henrik Bettermann
Message:

academics: Show students in departments.

students: Search for students in department.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
4 edited

Legend:

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

    r7191 r7205  
    7070    if changed_fields:
    7171        changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
     72    # Inform catalog if certificate has changed
     73    # (applyData does this only for the context)
     74    if 'certificate' in changed_fields:
     75        notify(grok.ObjectModifiedEvent(view.context.getStudent()))
    7276    fields_string = ' + '.join(changed_fields)
    73     #view.context._p_changed = True
    7477    view.flash('Form has been saved.')
    7578    if fields_string:
     
    599602    @property
    600603    def department(self):
    601         if self.context.certificate:
     604        if self.context.certificate is not None:
    602605            return self.context.certificate.__parent__.__parent__
    603606        return
     
    605608    @property
    606609    def faculty(self):
    607         if self.context.certificate:
     610        if self.context.certificate is not None:
    608611            return self.context.certificate.__parent__.__parent__.__parent__
    609612        return
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt

    r7068 r7205  
    1010    <option value="student_id">with id</option>
    1111    <option value="fullname">with name</option>
     12    <option value="reg_number">with registration number</option>
     13    <option value="matric_number">with matriculation number</option>
    1214    <option value="current_session">in session</option>
     15    <option value="depcode">in department</option>
    1316  </select>
    1417
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt

    r7068 r7205  
    1313    <option value="matric_number">with matriculation number</option>
    1414    <option value="current_session">in session</option>
     15    <option value="depcode">in department</option>
    1516  </select>
    1617
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7203 r7205  
    149149        self.certificate.end_level = 500
    150150        self.app['faculties']['fac1'] = Faculty()
    151         self.app['faculties']['fac1']['dep1'] = Department()
     151        self.app['faculties']['fac1']['dep1'] = Department(code='dep1')
    152152        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
    153153            self.certificate)
     
    196196        self.student['studycourse'].current_verdict = 'A'
    197197        self.student['studycourse'].current_level = 100
     198        # Update the catalog
     199        notify(grok.ObjectModifiedEvent(self.student))
    198200
    199201        # Put the prepopulated site into test ZODB and prepare test
     
    263265        self.browser.getControl(name="searchtype").value = ['student_id']
    264266        self.browser.getControl(name="searchterm").value = self.student_id
     267        self.browser.getControl("Search").click()
     268        self.assertTrue('Anna Tester' in self.browser.contents)
     269
     270        # We can find a student in a certain department
     271        self.browser.open(self.container_path)
     272        self.browser.getControl(name="searchtype").value = ['depcode']
     273        self.browser.getControl(name="searchterm").value = 'dep1'
    265274        self.browser.getControl("Search").click()
    266275        self.assertTrue('Anna Tester' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.