[7191] | 1 | ## $Id: interfaces.py 9131 2012-08-31 09:21:59Z henrik $ |
---|
[6621] | 2 | ## |
---|
[7191] | 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
[8409] | 18 | #from datetime import datetime |
---|
[7620] | 19 | from zope.component import getUtility |
---|
[7256] | 20 | from zope.interface import Attribute, Interface |
---|
[6621] | 21 | from zope import schema |
---|
[7620] | 22 | from zc.sourcefactory.contextual import BasicContextualSourceFactory |
---|
[7811] | 23 | from waeup.kofa.interfaces import ( |
---|
[8409] | 24 | IKofaObject, academic_sessions_vocab, validate_email, ICSVExporter) |
---|
[7811] | 25 | from waeup.kofa.interfaces import MessageFactory as _ |
---|
[8176] | 26 | from waeup.kofa.schema import TextLineChoice, FormattedDate, PhoneNumber |
---|
[7811] | 27 | from waeup.kofa.students.vocabularies import ( |
---|
[7915] | 28 | StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source, |
---|
| 29 | GenderSource, nats_vocab, |
---|
| 30 | ) |
---|
[8160] | 31 | from waeup.kofa.payments.interfaces import ( |
---|
[8174] | 32 | IPaymentsContainer, IOnlinePayment) |
---|
[7915] | 33 | from waeup.kofa.university.vocabularies import ( |
---|
| 34 | CourseSource, StudyModeSource, CertificateSource) |
---|
[6621] | 35 | |
---|
[7620] | 36 | # VerdictSource can't be placed into the vocabularies module because it |
---|
| 37 | # requires importing IStudentsUtils which then leads to circular imports. |
---|
| 38 | class VerdictSource(BasicContextualSourceFactory): |
---|
| 39 | """A verdicts source delivers all verdicts provided |
---|
| 40 | in the portal. |
---|
| 41 | """ |
---|
| 42 | def getValues(self, context): |
---|
[7841] | 43 | verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT |
---|
[8820] | 44 | return sorted(verdicts_dict.keys()) |
---|
[7620] | 45 | |
---|
| 46 | def getToken(self, context, value): |
---|
| 47 | return value |
---|
| 48 | |
---|
| 49 | def getTitle(self, context, value): |
---|
[7841] | 50 | verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT |
---|
[8820] | 51 | if value != '0': |
---|
| 52 | return verdicts_dict[value] + ' (%s)' % value |
---|
[7688] | 53 | return verdicts_dict[value] |
---|
[7620] | 54 | |
---|
[7681] | 55 | |
---|
[7150] | 56 | class IStudentsUtils(Interface): |
---|
| 57 | """A collection of methods which are subject to customization. |
---|
| 58 | |
---|
| 59 | """ |
---|
[7841] | 60 | def setReturningData(student): |
---|
| 61 | """ This method defines what happens after school fee payment |
---|
| 62 | depending on the student's senate verdict. |
---|
| 63 | |
---|
| 64 | In the base configuration current level is always increased |
---|
| 65 | by 100 no matter which verdict has been assigned. |
---|
| 66 | """ |
---|
| 67 | |
---|
[8595] | 68 | def setPaymentDetails(category, student): |
---|
| 69 | """Create Payment object and set the payment data of a student for |
---|
| 70 | the payment category specified. |
---|
[7150] | 71 | |
---|
| 72 | """ |
---|
| 73 | |
---|
[7186] | 74 | def getAccommodation_details(student): |
---|
[7150] | 75 | """Determine the accommodation dates of a student. |
---|
| 76 | |
---|
| 77 | """ |
---|
| 78 | |
---|
[7186] | 79 | def selectBed(available_beds): |
---|
[7150] | 80 | """Select a bed from a list of available beds. |
---|
| 81 | |
---|
| 82 | In the standard configuration we select the first bed found, |
---|
| 83 | but can also randomize the selection if we like. |
---|
| 84 | """ |
---|
| 85 | |
---|
[7186] | 86 | def renderPDF(view, subject='', filename='slip.pdf',): |
---|
[7150] | 87 | """Render pdf slips for various pages. |
---|
| 88 | |
---|
| 89 | """ |
---|
| 90 | |
---|
[7819] | 91 | class IStudentsContainer(IKofaObject): |
---|
[7096] | 92 | """A students container contains university students. |
---|
[6692] | 93 | |
---|
| 94 | """ |
---|
| 95 | def addStudent(student): |
---|
| 96 | """Add an IStudent object and subcontainers. |
---|
| 97 | |
---|
| 98 | """ |
---|
| 99 | |
---|
| 100 | def archive(id=None): |
---|
| 101 | """Create on-dist archive of students. |
---|
| 102 | |
---|
| 103 | If id is `None`, all students are archived. |
---|
| 104 | |
---|
| 105 | If id contains a single id string, only the respective |
---|
| 106 | students are archived. |
---|
| 107 | |
---|
| 108 | If id contains a list of id strings all of the respective |
---|
| 109 | students types are saved to disk. |
---|
| 110 | """ |
---|
| 111 | |
---|
| 112 | def clear(id=None, archive=True): |
---|
| 113 | """Remove students of type given by 'id'. |
---|
| 114 | |
---|
| 115 | Optionally archive the students. |
---|
| 116 | |
---|
| 117 | If id is `None`, all students are archived. |
---|
| 118 | |
---|
| 119 | If id contains a single id string, only the respective |
---|
| 120 | students are archived. |
---|
| 121 | |
---|
| 122 | If id contains a list of id strings all of the respective |
---|
| 123 | student types are saved to disk. |
---|
| 124 | |
---|
| 125 | If `archive` is ``False`` none of the archive-handling is done |
---|
| 126 | and respective students are simply removed from the |
---|
| 127 | database. |
---|
| 128 | """ |
---|
| 129 | |
---|
[8408] | 130 | unique_student_id = Attribute("""A unique student id.""") |
---|
| 131 | |
---|
[7819] | 132 | class IStudentNavigation(IKofaObject): |
---|
[8735] | 133 | """Interface needed for student navigation, logging, etc. |
---|
[7150] | 134 | |
---|
[6642] | 135 | """ |
---|
[8736] | 136 | student = Attribute('Student object of context.') |
---|
[7150] | 137 | |
---|
[8735] | 138 | def writeLogMessage(view, message): |
---|
| 139 | """Write a view specific log message into students.log. |
---|
| 140 | |
---|
| 141 | """ |
---|
| 142 | |
---|
[7819] | 143 | class IStudentBase(IKofaObject): |
---|
[6631] | 144 | """Representation of student base data. |
---|
[7150] | 145 | |
---|
[6621] | 146 | """ |
---|
[7062] | 147 | history = Attribute('Object history, a list of messages') |
---|
[6637] | 148 | state = Attribute('Returns the registration state of a student') |
---|
[6699] | 149 | password = Attribute('Encrypted password of a student') |
---|
[7203] | 150 | certcode = Attribute('The certificate code of any chosen study course') |
---|
| 151 | depcode = Attribute('The department code of any chosen study course') |
---|
| 152 | faccode = Attribute('The faculty code of any chosen study course') |
---|
[7062] | 153 | current_session = Attribute('The current session of the student') |
---|
[7641] | 154 | current_mode = Attribute('The current mode of the student') |
---|
[7364] | 155 | fullname = Attribute('All name parts separated by hyphens') |
---|
| 156 | display_fullname = Attribute('The fullname of an applicant') |
---|
[8969] | 157 | is_postgrad = Attribute('True if postgraduate student') |
---|
[6637] | 158 | |
---|
[8983] | 159 | suspended = schema.Bool( |
---|
| 160 | title = _(u'Account suspended'), |
---|
| 161 | default = False, |
---|
[9035] | 162 | required = False, |
---|
[8983] | 163 | ) |
---|
| 164 | |
---|
[6665] | 165 | student_id = schema.TextLine( |
---|
[7723] | 166 | title = _(u'Student Id'), |
---|
[6849] | 167 | required = False, |
---|
[6665] | 168 | ) |
---|
| 169 | |
---|
[7357] | 170 | firstname = schema.TextLine( |
---|
[7723] | 171 | title = _(u'First Name'), |
---|
[6621] | 172 | required = True, |
---|
| 173 | ) |
---|
| 174 | |
---|
[7357] | 175 | middlename = schema.TextLine( |
---|
[7723] | 176 | title = _(u'Middle Name'), |
---|
[7357] | 177 | required = False, |
---|
| 178 | ) |
---|
| 179 | |
---|
| 180 | lastname = schema.TextLine( |
---|
[7723] | 181 | title = _(u'Last Name (Surname)'), |
---|
[7357] | 182 | required = True, |
---|
| 183 | ) |
---|
| 184 | |
---|
[6996] | 185 | sex = schema.Choice( |
---|
[7723] | 186 | title = _(u'Sex'), |
---|
[6996] | 187 | source = GenderSource(), |
---|
| 188 | required = True, |
---|
| 189 | ) |
---|
| 190 | |
---|
[6788] | 191 | reg_number = TextLineChoice( |
---|
[7723] | 192 | title = _(u'Registration Number'), |
---|
[6696] | 193 | required = True, |
---|
| 194 | readonly = False, |
---|
[6788] | 195 | source = contextual_reg_num_source, |
---|
[6696] | 196 | ) |
---|
| 197 | |
---|
[6788] | 198 | matric_number = TextLineChoice( |
---|
[7723] | 199 | title = _(u'Matriculation Number'), |
---|
[6750] | 200 | required = False, |
---|
| 201 | readonly = False, |
---|
[6788] | 202 | source = contextual_mat_num_source, |
---|
[6750] | 203 | ) |
---|
| 204 | |
---|
[6769] | 205 | adm_code = schema.TextLine( |
---|
[7723] | 206 | title = _(u'PWD Activation Code'), |
---|
[6769] | 207 | required = False, |
---|
[8977] | 208 | readonly = False, |
---|
[6769] | 209 | ) |
---|
| 210 | |
---|
[7133] | 211 | email = schema.ASCIILine( |
---|
[7723] | 212 | title = _(u'Email'), |
---|
[7133] | 213 | required = False, |
---|
| 214 | constraint=validate_email, |
---|
| 215 | ) |
---|
[8176] | 216 | phone = PhoneNumber( |
---|
[7723] | 217 | title = _(u'Phone'), |
---|
[7331] | 218 | description = u'', |
---|
[7133] | 219 | required = False, |
---|
| 220 | ) |
---|
| 221 | |
---|
[9131] | 222 | def transfer(certificate, current_session, |
---|
| 223 | current_level, current_verdict): |
---|
| 224 | """ Creates a new studycourse and backups the old one. |
---|
| 225 | |
---|
| 226 | """ |
---|
| 227 | |
---|
[7993] | 228 | class IUGStudentClearance(IKofaObject): |
---|
| 229 | """Representation of undergraduate student clearance data. |
---|
[7150] | 230 | |
---|
[6631] | 231 | """ |
---|
[8160] | 232 | date_of_birth = FormattedDate( |
---|
[7723] | 233 | title = _(u'Date of Birth'), |
---|
[6631] | 234 | required = True, |
---|
[8160] | 235 | show_year = True, |
---|
[6631] | 236 | ) |
---|
| 237 | |
---|
[6695] | 238 | clearance_locked = schema.Bool( |
---|
[7723] | 239 | title = _(u'Clearance form locked'), |
---|
[6695] | 240 | default = False, |
---|
[9035] | 241 | required = False, |
---|
[6695] | 242 | ) |
---|
| 243 | |
---|
[6769] | 244 | clr_code = schema.TextLine( |
---|
[7723] | 245 | title = _(u'CLR Activation Code'), |
---|
[6769] | 246 | required = False, |
---|
[8977] | 247 | readonly = False, |
---|
[6769] | 248 | ) |
---|
| 249 | |
---|
[7523] | 250 | nationality = schema.Choice( |
---|
[8069] | 251 | vocabulary = nats_vocab, |
---|
[7723] | 252 | title = _(u'Nationality'), |
---|
[7983] | 253 | required = False, |
---|
[7523] | 254 | ) |
---|
| 255 | |
---|
[7993] | 256 | class IPGStudentClearance(IUGStudentClearance): |
---|
| 257 | """Representation of postgraduate student clearance data. |
---|
| 258 | |
---|
| 259 | """ |
---|
| 260 | employer = schema.TextLine( |
---|
| 261 | title = _(u'Employer'), |
---|
| 262 | required = False, |
---|
| 263 | readonly = False, |
---|
| 264 | ) |
---|
| 265 | |
---|
[7819] | 266 | class IStudentPersonal(IKofaObject): |
---|
[6631] | 267 | """Representation of student personal data. |
---|
[7150] | 268 | |
---|
[6631] | 269 | """ |
---|
[6651] | 270 | perm_address = schema.Text( |
---|
[7723] | 271 | title = _(u'Permanent Address'), |
---|
[6631] | 272 | required = False, |
---|
| 273 | ) |
---|
| 274 | |
---|
[8008] | 275 | class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance, |
---|
| 276 | IStudentPersonal): |
---|
[6631] | 277 | """Representation of a student. |
---|
[7150] | 278 | |
---|
[6631] | 279 | """ |
---|
| 280 | |
---|
[6849] | 281 | class IStudentUpdateByRegNo(IStudent): |
---|
| 282 | """Representation of a student. Skip regular reg_number validation. |
---|
[7150] | 283 | |
---|
[6849] | 284 | """ |
---|
| 285 | reg_number = schema.TextLine( |
---|
[7723] | 286 | title = _(u'Registration Number'), |
---|
[6849] | 287 | required = False, |
---|
| 288 | ) |
---|
| 289 | |
---|
| 290 | class IStudentUpdateByMatricNo(IStudent): |
---|
| 291 | """Representation of a student. Skip regular matric_number validation. |
---|
[7150] | 292 | |
---|
[6849] | 293 | """ |
---|
| 294 | matric_number = schema.TextLine( |
---|
[7723] | 295 | title = _(u'Matriculation Number'), |
---|
[6849] | 296 | required = False, |
---|
| 297 | ) |
---|
| 298 | |
---|
[8779] | 299 | class IStudentRequestPW(IStudent): |
---|
| 300 | """Representation of an student for first-time password request. |
---|
| 301 | |
---|
| 302 | This interface is used when students use the requestpw page to |
---|
| 303 | login for the the first time. |
---|
| 304 | """ |
---|
[8854] | 305 | number = schema.TextLine( |
---|
| 306 | title = _(u'Registr. or Matric. Number'), |
---|
[8779] | 307 | required = True, |
---|
| 308 | ) |
---|
| 309 | |
---|
| 310 | firstname = schema.TextLine( |
---|
| 311 | title = _(u'First Name'), |
---|
| 312 | required = True, |
---|
| 313 | ) |
---|
| 314 | |
---|
| 315 | email = schema.ASCIILine( |
---|
| 316 | title = _(u'Email Address'), |
---|
| 317 | required = True, |
---|
| 318 | constraint=validate_email, |
---|
| 319 | ) |
---|
| 320 | |
---|
[7819] | 321 | class IStudentStudyCourse(IKofaObject): |
---|
[6633] | 322 | """A container for student study levels. |
---|
| 323 | |
---|
| 324 | """ |
---|
[6648] | 325 | certificate = schema.Choice( |
---|
[7723] | 326 | title = _(u'Certificate'), |
---|
[6648] | 327 | source = CertificateSource(), |
---|
[7209] | 328 | required = False, |
---|
[6633] | 329 | ) |
---|
[6635] | 330 | |
---|
[6996] | 331 | entry_mode = schema.Choice( |
---|
[7723] | 332 | title = _(u'Entry Mode'), |
---|
[7681] | 333 | source = StudyModeSource(), |
---|
[6996] | 334 | required = True, |
---|
| 335 | readonly = False, |
---|
| 336 | ) |
---|
| 337 | |
---|
| 338 | entry_session = schema.Choice( |
---|
[7723] | 339 | title = _(u'Entry Session'), |
---|
[6996] | 340 | source = academic_sessions_vocab, |
---|
[7425] | 341 | #default = datetime.now().year, |
---|
[6996] | 342 | required = True, |
---|
| 343 | readonly = False, |
---|
| 344 | ) |
---|
| 345 | |
---|
[6724] | 346 | current_session = schema.Choice( |
---|
[7723] | 347 | title = _(u'Current Session'), |
---|
[6744] | 348 | source = academic_sessions_vocab, |
---|
[6724] | 349 | required = True, |
---|
[6996] | 350 | readonly = False, |
---|
[6724] | 351 | ) |
---|
| 352 | |
---|
| 353 | current_level = schema.Choice( |
---|
[7723] | 354 | title = _(u'Current Level'), |
---|
[6725] | 355 | source = StudyLevelSource(), |
---|
| 356 | required = False, |
---|
[6996] | 357 | readonly = False, |
---|
[6724] | 358 | ) |
---|
| 359 | |
---|
| 360 | current_verdict = schema.Choice( |
---|
[7723] | 361 | title = _(u'Current Verdict'), |
---|
[7619] | 362 | source = VerdictSource(), |
---|
[8820] | 363 | default = '0', |
---|
[6725] | 364 | required = False, |
---|
[6724] | 365 | ) |
---|
| 366 | |
---|
| 367 | previous_verdict = schema.Choice( |
---|
[7723] | 368 | title = _(u'Previous Verdict'), |
---|
[7619] | 369 | source = VerdictSource(), |
---|
[8820] | 370 | default = '0', |
---|
[6725] | 371 | required = False, |
---|
[6724] | 372 | ) |
---|
| 373 | |
---|
[7951] | 374 | class IStudentVerdictUpdate(IKofaObject): |
---|
| 375 | """A interface for verdict imports. |
---|
| 376 | |
---|
| 377 | """ |
---|
| 378 | |
---|
| 379 | current_verdict = schema.Choice( |
---|
| 380 | title = _(u'Current Verdict'), |
---|
| 381 | source = VerdictSource(), |
---|
| 382 | required = True, |
---|
| 383 | ) |
---|
| 384 | |
---|
| 385 | current_session = schema.Choice( |
---|
| 386 | title = _(u'Current Session'), |
---|
| 387 | source = academic_sessions_vocab, |
---|
| 388 | required = True, |
---|
| 389 | ) |
---|
| 390 | |
---|
| 391 | current_level = schema.Choice( |
---|
| 392 | title = _(u'Current Level'), |
---|
| 393 | source = StudyLevelSource(), |
---|
| 394 | required = True, |
---|
| 395 | ) |
---|
| 396 | |
---|
[7819] | 397 | class IStudentStudyLevel(IKofaObject): |
---|
[6774] | 398 | """A container for course tickets. |
---|
| 399 | |
---|
| 400 | """ |
---|
| 401 | level = Attribute('The level code') |
---|
[6793] | 402 | validation_date = Attribute('The date of validation') |
---|
| 403 | validated_by = Attribute('User Id of course adviser') |
---|
[6774] | 404 | |
---|
[6793] | 405 | level_session = schema.Choice( |
---|
[7723] | 406 | title = _(u'Session'), |
---|
[6793] | 407 | source = academic_sessions_vocab, |
---|
| 408 | required = True, |
---|
| 409 | ) |
---|
[6781] | 410 | |
---|
[6793] | 411 | level_verdict = schema.Choice( |
---|
[7723] | 412 | title = _(u'Verdict'), |
---|
[7619] | 413 | source = VerdictSource(), |
---|
[8820] | 414 | default = '0', |
---|
[6793] | 415 | required = False, |
---|
| 416 | ) |
---|
| 417 | |
---|
[8920] | 418 | def addCourseTicket(ticket, course): |
---|
[8182] | 419 | """Add a course ticket object. |
---|
| 420 | """ |
---|
| 421 | |
---|
[7819] | 422 | class ICourseTicket(IKofaObject): |
---|
[6781] | 423 | """A course ticket. |
---|
| 424 | |
---|
| 425 | """ |
---|
[6783] | 426 | code = Attribute('code of the original course') |
---|
| 427 | title = Attribute('title of the original course') |
---|
| 428 | credits = Attribute('credits of the original course') |
---|
| 429 | passmark = Attribute('passmark of the original course') |
---|
| 430 | semester = Attribute('semester of the original course') |
---|
[7304] | 431 | fcode = Attribute('faculty code of the original course') |
---|
| 432 | dcode = Attribute('department code of the original course') |
---|
[6781] | 433 | |
---|
[7665] | 434 | mandatory = schema.Bool( |
---|
[7723] | 435 | title = _(u'Mandatory'), |
---|
[6795] | 436 | default = False, |
---|
| 437 | required = False, |
---|
| 438 | readonly = False, |
---|
| 439 | ) |
---|
| 440 | |
---|
[6781] | 441 | score = schema.Int( |
---|
[7723] | 442 | title = _(u'Score'), |
---|
[6781] | 443 | default = 0, |
---|
| 444 | required = False, |
---|
| 445 | readonly = False, |
---|
| 446 | ) |
---|
| 447 | |
---|
[6806] | 448 | automatic = schema.Bool( |
---|
[7723] | 449 | title = _(u'Automatical Creation'), |
---|
[6806] | 450 | default = False, |
---|
| 451 | required = False, |
---|
| 452 | readonly = True, |
---|
| 453 | ) |
---|
| 454 | |
---|
[7661] | 455 | carry_over = schema.Bool( |
---|
[7723] | 456 | title = _(u'Carry-over Course'), |
---|
[7661] | 457 | default = False, |
---|
| 458 | required = False, |
---|
| 459 | readonly = False, |
---|
| 460 | ) |
---|
| 461 | |
---|
[7633] | 462 | def getLevel(): |
---|
| 463 | """Returns the id of the level the ticket has been added to. |
---|
| 464 | """ |
---|
| 465 | |
---|
| 466 | def getLevelSession(): |
---|
| 467 | """Returns the session of the level the ticket has been added to. |
---|
| 468 | """ |
---|
| 469 | |
---|
[6795] | 470 | class ICourseTicketAdd(ICourseTicket): |
---|
[7150] | 471 | """An interface for adding course tickets. |
---|
[6795] | 472 | |
---|
| 473 | """ |
---|
| 474 | course = schema.Choice( |
---|
[7723] | 475 | title = _(u'Course'), |
---|
[6795] | 476 | source = CourseSource(), |
---|
| 477 | readonly = False, |
---|
| 478 | ) |
---|
| 479 | |
---|
[7819] | 480 | class IStudentAccommodation(IKofaObject): |
---|
[6635] | 481 | """A container for student accommodation objects. |
---|
| 482 | |
---|
| 483 | """ |
---|
| 484 | |
---|
[7819] | 485 | class IBedTicket(IKofaObject): |
---|
[6989] | 486 | """A ticket for accommodation booking. |
---|
| 487 | |
---|
| 488 | """ |
---|
[6996] | 489 | bed = Attribute('The bed object.') |
---|
| 490 | |
---|
| 491 | bed_coordinates = schema.TextLine( |
---|
[7723] | 492 | title = _(u'Bed Coordinates'), |
---|
[6992] | 493 | required = False, |
---|
[7014] | 494 | readonly = False, |
---|
[6992] | 495 | ) |
---|
| 496 | |
---|
[6996] | 497 | bed_type = schema.TextLine( |
---|
[7723] | 498 | title = _(u'Bed Type'), |
---|
[6996] | 499 | required = False, |
---|
[7014] | 500 | readonly = False, |
---|
[6996] | 501 | ) |
---|
| 502 | |
---|
[6992] | 503 | booking_session = schema.Choice( |
---|
[7723] | 504 | title = _(u'Session'), |
---|
[6992] | 505 | source = academic_sessions_vocab, |
---|
| 506 | required = True, |
---|
[7014] | 507 | readonly = True, |
---|
[6992] | 508 | ) |
---|
| 509 | |
---|
[8170] | 510 | booking_date = schema.Datetime( |
---|
[7723] | 511 | title = _(u'Booking Date'), |
---|
[6992] | 512 | required = False, |
---|
[7014] | 513 | readonly = True, |
---|
[6992] | 514 | ) |
---|
| 515 | |
---|
| 516 | booking_code = schema.TextLine( |
---|
[7723] | 517 | title = _(u'Booking Activation Code'), |
---|
[6992] | 518 | required = False, |
---|
[7014] | 519 | readonly = True, |
---|
[6992] | 520 | ) |
---|
| 521 | |
---|
[6994] | 522 | def getSessionString(): |
---|
[7633] | 523 | """Returns the title of academic_sessions_vocab term. |
---|
[7150] | 524 | |
---|
[6994] | 525 | """ |
---|
[6992] | 526 | |
---|
[6860] | 527 | class IStudentPaymentsContainer(IPaymentsContainer): |
---|
[6635] | 528 | """A container for student payment objects. |
---|
| 529 | |
---|
| 530 | """ |
---|
| 531 | |
---|
[6877] | 532 | class IStudentOnlinePayment(IOnlinePayment): |
---|
| 533 | """A student payment via payment gateways. |
---|
| 534 | |
---|
| 535 | """ |
---|
| 536 | |
---|
[8268] | 537 | p_level = schema.Int( |
---|
| 538 | title = _(u'Payment Level'), |
---|
| 539 | required = False, |
---|
| 540 | readonly = True, |
---|
| 541 | ) |
---|
[6877] | 542 | |
---|
[8422] | 543 | def doAfterStudentPayment(): |
---|
| 544 | """Process student after payment was made. |
---|
| 545 | |
---|
| 546 | """ |
---|
| 547 | |
---|
[8453] | 548 | def doAfterStudentPaymentApproval(): |
---|
| 549 | """Process student after payment was approved. |
---|
| 550 | |
---|
| 551 | """ |
---|
| 552 | |
---|
[8420] | 553 | def approveStudentPayment(): |
---|
[8422] | 554 | """Approve payment and process student. |
---|
[8420] | 555 | |
---|
| 556 | """ |
---|
| 557 | |
---|
[8268] | 558 | IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[ |
---|
| 559 | 'p_session'].order |
---|
[8408] | 560 | |
---|
| 561 | class ICSVStudentExporter(ICSVExporter): |
---|
| 562 | """A regular ICSVExporter that additionally supports exporting |
---|
| 563 | data from a given student object. |
---|
| 564 | """ |
---|
| 565 | |
---|
| 566 | def export_student(student, filepath=None): |
---|
| 567 | """Export data for a given student. |
---|
| 568 | """ |
---|