Changeset 5122 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 5 Apr 2010, 11:55:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.txt
r5118 r5122 181 181 When a code cannot be found :exc:`KeyError` is raised. 182 182 183 .. method:: addAccessCode(serial_num, random_num) 184 185 Add an access code to the batch. 186 187 ``serial_num`` denotes the serial number of the new access-code 188 inside the batch. ``random_num`` is a string of 10 digits unique 189 in this batch. 190 183 191 .. method:: invalidate(ac_id[, student_id=None]) 184 192 … … 273 281 >>> ac.student_id 274 282 'some_user_id' 283 284 Access codes get their ``cost`` from the batch they belong to. Note, 285 that it is advisable to print costs always using a format, as Python 286 floats are often represented by irritating values: 287 288 >>> ac.cost 289 12.119999999999999 290 291 >>> print "%0.2f" % ac.cost 292 12.12 293 294 295 AccessCodeBatchContainer 296 ======================== 297 298 .. class:: AccessCodeBatchContainer() 299 300 A container for access code batches. 301 302 .. method:: addBatch(batch) 303 304 Add a batch in this container. 305 306 .. method:: getNum(prefix) 307 308 Get next unused num for a new batch and a given prefix. 309 310 Batches for a given prefix are numerated. Whenever a new batch 311 is created and other batches inside the container already have 312 the same prefix, the new one will get the lowest unused number. 275 313 276 314
Note: See TracChangeset for help on using the changeset viewer.