- Timestamp:
- 13 Nov 2011, 06:13:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7097 r7099 54 54 self.student_id = u'Z654321' 55 55 self.password = None 56 57 56 return 58 57 … … 145 144 146 145 class StudentFileNameChooser(grok.Adapter): 147 """A file id chooser for :class:` Applicant` objects.148 149 `context` is an :class:` Applicant` instance.150 151 The :class:` ApplicantImageNameChooser` can build/check file ids152 for :class:`Applicant` objects suitable for use with146 """A file id chooser for :class:`Student` objects. 147 148 `context` is an :class:`Student` instance. 149 150 The :class:`StudentImageNameChooser` can build/check file ids for 151 :class:`Student` objects suitable for use with 153 152 :class:`ExtFileStore` instances. The delivered file_id contains 154 the file id marker for :class:`Applicant` object and the 155 registration number or access code of the context applicant. Also 156 the name of the connected applicant container will be part of the 157 generated file id. 153 the file id marker for :class:`Student` object and the student id 154 of the context student. 158 155 159 156 This chooser is registered as an adapter providing … … 161 158 162 159 File store name choosers like this one are only convenience 163 components to ease the task of creating file ids for applicant160 components to ease the task of creating file ids for student 164 161 objects. You are nevertheless encouraged to use them instead of 165 manually setting up filenames for applicants.162 manually setting up filenames for students. 166 163 167 164 .. seealso:: :mod:`waeup.sirp.imagestorage` … … 197 194 198 195 """ 199 first_character = self.context.student_id[0]196 stud_id = self.context.student_id 200 197 marked_filename = '__%s__%s/%s/%s_%s.jpg' % ( 201 STUDENT_FILE_STORE_NAME, first_character, 202 self.context.student_id, attr, self.context.student_id) 198 STUDENT_FILE_STORE_NAME, stud_id[0], stud_id, attr, stud_id) 203 199 return marked_filename 204 200 … … 223 219 224 220 def pathFromFileID(self, store, root, file_id): 225 """All applicants images are filed in directory ``applicants``.221 """All student files are put in directory ``students``. 226 222 """ 227 223 marker, filename, basename, ext = store.extractMarker(file_id)
Note: See TracChangeset for help on using the changeset viewer.