Changeset 6651 for main/waeup.sirp/trunk
- Timestamp:
- 29 Aug 2011, 11:03:35 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6650 r6651 67 67 IStudentPayments, IStudentAccommodation, IStudentNavigation 68 68 ) 69 from waeup.sirp.students.student import ( 70 Student, 71 ) 69 from waeup.sirp.students.student import Student 72 70 from waeup.sirp.students.catalog import search 73 71 … … 228 226 @grok.action('Create student record') 229 227 def addStudent(self, **data): 230 student_id = self.request.form.get('form.student_id')231 228 student = createObject(u'waeup.Student') 232 student.student_id = student_id233 229 self.applyData(student, **data) 234 230 try: … … 238 234 return 239 235 self.flash('Student record created.') 240 self.redirect(self.url(self.context[student _id], 'index'))236 self.redirect(self.url(self.context[student.student_id], 'index')) 241 237 return 242 238 -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt
r6631 r6651 6 6 <table> 7 7 <tbody> 8 <tr>9 <td><label for="form.student_id">Student Id:</label></td>10 <td>11 <input name="form.student_id" type="text" size="7" maxlength="7"12 value="" />13 </td>14 </tr>15 8 <tr> 16 9 <td><label for="form.name">Full Name:</label></td> -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6648 r6651 21 21 history = Attribute('Object history, a list of messages.') 22 22 state = Attribute('Returns the registration state of a student') 23 student_id = Attribute('Randomly generated id') 23 24 24 25 def loggerInfo(ob_class, comment): 25 26 """Adds an INFO message to the log file 26 27 """ 27 28 student_id = schema.TextLine(29 title = u'Student Id',30 default = u'None',31 required = True,32 )33 28 34 29 name = schema.TextLine( … … 51 46 """ 52 47 53 perm_address = schema. Date(48 perm_address = schema.Text( 54 49 title = u'Permanent Address', 55 50 required = False, -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r6642 r6651 25 25 from waeup.sirp.students.interfaces import IStudent, IStudentNavigation 26 26 from waeup.sirp.utils.helpers import attrs_to_fields 27 from waeup.sirp.students.utils import generate_student_id 27 28 28 29 class Student(grok.Container): … … 36 37 super(Student, self).__init__() 37 38 IWorkflowInfo(self).fireTransition('create') 39 self.student_id = generate_student_id('?') 38 40 return 39 41
Note: See TracChangeset for help on using the changeset viewer.