Ignore:
Timestamp:
14 Feb 2012, 07:07:46 (13 years ago)
Author:
Henrik Bettermann
Message:

Add current_mode index to students_catalog.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
8 edited

Legend:

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

    r7640 r7641  
    590590    @property
    591591    def current_mode(self):
    592         if self.context.certificate:
     592        if self.context.certificate is not None:
    593593            current_mode = study_modes.getTermByToken(
    594594                self.context.certificate.study_mode).title
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt

    r7553 r7641  
    1111    <option value="current_session">in session</option>
    1212    <option value="depcode">in department</option>
     13    <option value="current_mode">in study mode</option>
    1314  </select>
    1415
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt

    r7553 r7641  
    1111    <option value="current_session">in session</option>
    1212    <option value="depcode">in department</option>
     13    <option value="current_mode">in study mode</option>
    1314  </select>
    1415
  • main/waeup.sirp/trunk/src/waeup/sirp/students/catalog.py

    r7633 r7641  
    4747    faccode = index.Field(attribute='faccode')
    4848    current_session = index.Field(attribute='current_session')
     49    current_mode = index.Field(attribute='current_mode')
    4950
    5051class StudentQueryResultItem(object):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r7633 r7641  
    134134    faccode = Attribute('The faculty code of any chosen study course')
    135135    current_session = Attribute('The current session of the student')
     136    current_mode = Attribute('The current mode of the student')
    136137    fullname = Attribute('All name parts separated by hyphens')
    137138    display_fullname = Attribute('The fullname of an applicant')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r7538 r7641  
    111111    @property
    112112    def current_session(self):
    113         cert = getattr(self.get('studycourse', None), 'current_session', None)
    114         return cert
     113        session = getattr(self.get('studycourse', None), 'current_session', None)
     114        return session
     115
     116    @property
     117    def current_mode(self):
     118        certificate = getattr(self.get('studycourse', None), 'certificate', None)
     119        if certificate is not None:
     120            return certificate.study_mode
     121        return
    115122
    116123# Set all attributes of Student required in IStudent as field
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7639 r7641  
    271271        self.browser.getControl(name="searchtype").value = ['student_id']
    272272        self.browser.getControl(name="searchterm").value = self.student_id
     273        self.browser.getControl("Search").click()
     274        self.assertTrue('Anna Tester' in self.browser.contents)
     275
     276        # We can find a student in a certain session
     277        self.browser.open(self.container_path)
     278        self.browser.getControl(name="searchtype").value = ['current_session']
     279        self.browser.getControl(name="searchterm").value = '2004'
     280        self.browser.getControl("Search").click()
     281        self.assertTrue('Anna Tester' in self.browser.contents)
     282
     283        # We can find a student in a certain study_mode
     284        self.browser.open(self.container_path)
     285        self.browser.getControl(name="searchtype").value = ['current_mode']
     286        self.browser.getControl(name="searchterm").value = 'ug_ft'
    273287        self.browser.getControl("Search").click()
    274288        self.assertTrue('Anna Tester' in self.browser.contents)
     
    598612        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    599613        self.assertEqual(self.browser.url, self.studycourse_student_path)
     614        self.assertTrue('Undergraduate Full Time' in self.browser.contents)
    600615        self.browser.getLink("Manage").click()
    601616        self.assertTrue('Manage study course' in self.browser.contents)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/catalog.py

    r7211 r7641  
    5656class CertificateCoursesIndexes(grok.Indexes):
    5757    """This catalog is needed for automatic removal of certificate courses
    58     and later for selection course tickets in the students section.
     58    and later for selection of course tickets in the students section.
    5959    """
    6060    grok.site(IUniversity)
     
    6767@grok.subscribe(ICourse, grok.IObjectAddedEvent)
    6868def handle_course_added(obj, event):
    69     """Index an added course with the local catalog.
     69    """Index an add course with the local catalog.
    7070
    7171    Courses are not indexed automatically, as they are not a
Note: See TracChangeset for help on using the changeset viewer.