Changeset 6818 for main/waeup.sirp/trunk


Ignore:
Timestamp:
27 Sep 2011, 08:00:33 (13 years ago)
Author:
Henrik Bettermann
Message:

Replace student's name attribute by fullname attributes to avoid confusion.

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

Legend:

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

    r6690 r6818  
    161161        """
    162162        if IStudentNavigation.providedBy(self.context):
    163             return self.context.getStudent().name
     163            return self.context.getStudent().fullname
    164164        return
    165165
  • main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py

    r6768 r6818  
    5252    @property
    5353    def title(self):
    54         return self.context.name
     54        return self.context.fullname
    5555
    5656    @property
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6810 r6818  
    7979    title = u'Students'
    8080
     81class StudentBreadcrumb(Breadcrumb):
     82    """A breadcrumb for the student container.
     83    """
     84    grok.context(IStudent)
     85
     86    def title(self):
     87        return self.context.fullname
     88
    8189class SudyCourseBreadcrumb(Breadcrumb):
    8290    """A breadcrumb for the student study course.
     
    292300    @property
    293301    def label(self):
    294         return '%s: Base Data' % self.context.name
     302        return '%s: Base Data' % self.context.fullname
    295303
    296304    @property
     
    393401    @property
    394402    def label(self):
    395         return '%s: Clearance Data' % self.context.name
     403        return '%s: Clearance Data' % self.context.fullname
    396404
    397405class StudentClearanceManageActionButton(ManageActionButton):
     
    437445    @property
    438446    def label(self):
    439         return '%s: Personal Data' % self.context.name
     447        return '%s: Personal Data' % self.context.fullname
    440448
    441449class StudentPersonalManageActionButton(ManageActionButton):
     
    476484    @property
    477485    def label(self):
    478         return '%s: Study Course' % self.context.__parent__.name
     486        return '%s: Study Course' % self.context.__parent__.fullname
    479487
    480488class StudyCourseManageActionButton(ManageActionButton):
     
    573581    def label(self):
    574582        return '%s: Study Level %s' % (
    575             self.context.getStudent().name,self.context.level_title)
     583            self.context.getStudent().fullname,self.context.level_title)
    576584
    577585    @property
     
    707715    def label(self):
    708716        return '%s: Course Ticket %s' % (
    709             self.context.getStudent().name,self.context.code)
     717            self.context.getStudent().fullname,self.context.code)
    710718
    711719class CourseTicketManageActionButton(ManageActionButton):
     
    753761    @property
    754762    def label(self):
    755         return '%s: Payments' % self.context.__parent__.name
     763        return '%s: Payments' % self.context.__parent__.fullname
    756764
    757765class AccommodationDisplayFormPage(WAeUPDisplayFormPage):
     
    768776    @property
    769777    def label(self):
    770         return '%s: Accommodation Data' % self.context.__parent__.name
     778        return '%s: Accommodation Data' % self.context.__parent__.fullname
    771779
    772780class StudentHistoryPage(WAeUPPage):
     
    782790    @property
    783791    def label(self):
    784         return '%s: History' % self.context.name
     792        return '%s: History' % self.context.fullname
    785793
    786794# Pages for students only
     
    805813
    806814    def __init__(self, context):
    807         self.name = context.name
     815        self.name = context.fullname
    808816        self.password_repeat = context.password
    809817        self.context = context
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt

    r6765 r6818  
    99  <select name="searchtype">
    1010    <option value="student_id">with id</option>
    11     <option value="name">with name</option>
     11    <option value="fullname">with name</option>
    1212    <option value="reg_number">with registration number</option>
    1313    <option value="matric_number">with matriculation number</option>
     
    2323    <input type="hidden" name="old_searchtype"
    2424         tal:attributes="value view/searchtype" />
    25     <table class="display dataTableManage">
     25    <table class="display dataTable">
    2626      <thead>
    2727      <tr>
     
    2929        <th>Registration Number</th>
    3030        <th>Matriculation Number</th>
    31         <th>Name</th>
     31        <th>Fullname</th>
    3232      </tr>
    3333      </thead>
     
    4343          <span tal:content="item/matric_number">9999999</span></a>
    4444        </td>
    45         <td tal:content="item/name">Bob</td>
     45        <td tal:content="item/fullname">Bob</td>
    4646      </tr>
    4747      </tbody>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt

    r6651 r6818  
    77    <tbody>
    88      <tr>
    9         <td><label for="form.name">Full Name:</label></td>
     9        <td><label for="form.fullname">Full Name:</label></td>
    1010        <td>
    11          <input name="form.name" type="text" size="30" maxlength="30"
     11         <input name="form.fullname" type="text" size="30" maxlength="30"
    1212                value="" />
    1313        </td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/catalog.py

    r6814 r6818  
    1818
    1919    student_id = index.Field(attribute='student_id')
    20     name = index.Text(attribute='name')
     20    fullname = index.Text(attribute='fullname')
    2121    reg_number = index.Field(attribute='reg_number')
    2222    matric_number = index.Field(attribute='matric_number')
     
    3434        self.url = view.url(context)
    3535        self.student_id = context.student_id
    36         self.name = context.name
     36        self.fullname = context.fullname
    3737        self.reg_number = context.reg_number
    3838        self.matric_number = context.matric_number
     
    4141def search(query=None, searchtype=None, view=None):
    4242    hitlist = []
    43     if searchtype in ('name',):
     43    if searchtype in ('fullname',):
    4444        results = Query().searchResults(
    4545            Text(('students_catalog', searchtype), query))
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r6814 r6818  
    103103        )
    104104
    105     name = schema.TextLine(
     105    fullname = schema.TextLine(
    106106        title = u'Full Name',
    107         default = u'Nobody',
     107        default = None,
    108108        required = True,
    109109        )
     
    111111    reg_number = TextLineChoice(
    112112        title = u'Registration Number',
    113         #default = u'',
     113        default = None,
    114114        required = True,
    115115        readonly = False,
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py

    r6756 r6818  
    6565class FakeStudent(object):
    6666    student_id = 'test_stud'
    67     name = 'Test User'
     67    fullname = 'Test User'
    6868    password = None
    6969
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r6810 r6818  
    6969        setSite(app)
    7070
    71         # Add student with subobjects (done by addStudent)
     71        # Add student with subobjects
    7272        student = Student()
    73         student.name = u'Anna Tester'
     73        student.fullname = u'Anna Tester'
    7474        student.reg_number = u'123'
    7575        student.matric_number = u'234'
     
    186186        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    187187        self.assertEqual(self.browser.url, self.add_student_path)
    188         self.browser.getControl(name="form.name").value = 'Bob Tester'
     188        self.browser.getControl(name="form.fullname").value = 'Bob Tester'
    189189        self.browser.getControl("Create student record").click()
    190190        self.assertTrue('Student record created' in self.browser.contents)
     
    213213        self.browser.getControl("Search").click()
    214214        self.assertTrue('Empty search string' in self.browser.contents)
    215         self.browser.getControl(name="searchtype").value = ['name']
     215        self.browser.getControl(name="searchtype").value = ['fullname']
    216216        self.browser.getControl(name="searchterm").value = 'Anna Tester'
    217217        self.browser.getControl("Search").click()
     
    255255        # Managers can edit base data and fire transitions
    256256        self.browser.getControl(name="transition").value = ['admit']
    257         self.browser.getControl(name="form.name").value = 'John Tester'
     257        self.browser.getControl(name="form.fullname").value = 'John Tester'
    258258        self.browser.getControl(name="form.reg_number").value = '345'
    259259        self.browser.getControl(name="password").value = 'secret'
     
    429429        student = Student()
    430430        student.reg_number = u'123456'
    431         student.name = u'Klaus Tester'
     431        student.fullname = u'Klaus Tester'
    432432        test_student_id = self.app['students'].addStudent(student)
    433433        setpassword_path = 'http://localhost/app/setpassword'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py

    r6733 r6818  
    4444        # Create students
    4545        student = Student()
    46         student.name = u'Bob Tester'
     46        student.fullname = u'Bob Tester'
    4747        student.student_id = u'A123456'
    4848        self.app['students'][student.student_id] = student
     
    7474        # We can find a certain name
    7575        cat = queryUtility(ICatalog, name='students_catalog')
    76         results = cat.searchResults(name='Bob Tester')
     76        results = cat.searchResults(fullname='Bob Tester')
    7777        results = [x for x in results] # Turn results generator into list
    7878        assert len(results) == 1
Note: See TracChangeset for help on using the changeset viewer.