Ignore:
Timestamp:
20 Nov 2012, 06:36:54 (12 years ago)
Author:
Henrik Bettermann
Message:

Use new attrs_to_fields function to display gpa and total_credits on level pages.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/studylevelpage.pt

    r9688 r9691  
    1515      </tr>
    1616    </tal:block>
    17     <tr>
    18       <td i18n:translate="">
    19         Total Credits:
    20       </td>
    21       <td>
    22         <span tal:replace="view/context/total_credits">TOTAL</span>
    23       </td>
    24     </tr>
    25     <tr>
    26       <td i18n:translate="">
    27         Momentary GPA:
    28       </td>
    29       <td>
    30         <span tal:replace="python: '%4.2f' % view.context.gpa">2.33</span>
    31       </td>
    32     </tr>
    3317  </tbody>
    3418</table>
  • main/waeup.uniben/trunk/src/waeup/uniben/students/studylevel.py

    r8865 r9691  
    3838    grok.provides(ICustomStudentStudyLevel)
    3939
    40 CustomStudentStudyLevel = attrs_to_fields(CustomStudentStudyLevel)
     40CustomStudentStudyLevel = attrs_to_fields(
     41    CustomStudentStudyLevel, omit=['total_credits', 'gpa'])
    4142
    4243class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r9688 r9691  
    345345        self.browser.getLink("100").click()
    346346        # GPA has been properly calculated and is shown on the page
    347         self.assertTrue('3.00' in self.browser.contents)
     347        self.assertTrue('3.0' in self.browser.contents)
    348348        self.assertEqual(self.student['studycourse']['100'].gpa, 3.0)
    349349        # Score is not shown but grade
Note: See TracChangeset for help on using the changeset viewer.