Changeset 7105 for main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
- Timestamp:
- 13 Nov 2011, 17:50:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7103 r7105 177 177 return name == self.chooseName() 178 178 179 def chooseName(self, name=None, attr=None , ext=u''):179 def chooseName(self, name=None, attr=None): 180 180 """Get a valid file id for student context. 181 181 182 182 *Example:* 183 183 184 For a student with student id ``'A123456'``, 185 with attr ``'nice_image'`` and an uploaded file named 186 `'anybasename.JPG'`` to be stored in 184 For a student with student id ``'A123456'`` and 185 with attr ``'nice_image'`` stored in 187 186 the students container this chooser would create: 188 187 … … 195 194 196 195 """ 197 if name and name.count('.') == 1:198 basename, ext = os.path.splitext(name)199 ext.lower()200 196 stud_id = self.context.student_id 201 marked_filename = '__%s__%s/%s/%s_%s %s' % (202 STUDENT_FILE_STORE_NAME, stud_id[0], stud_id, attr, stud_id , ext)197 marked_filename = '__%s__%s/%s/%s_%s.jpg' % ( 198 STUDENT_FILE_STORE_NAME, stud_id[0], stud_id, attr, stud_id) 203 199 return marked_filename 204 200
Note: See TracChangeset for help on using the changeset viewer.