Changeset 11687
- Timestamp:
- 16 Jun 2014, 08:29:22 (11 years ago)
- Location:
- main/kofacustom.sampleuni/trunk
- Files:
-
- 1 deleted
- 42 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.sampleuni/trunk/CHANGES.txt
r11647 r11687 2 2 ******* 3 3 4 1.2dev (unreleased) 5 =================== 6 7 * Use init_update method. 8 9 * Use base classes InterswitchPageApplicant and InterswitchPageStudent from 10 kofacustom.nigeria. 11 12 * File input fields brought into shape with Bootstrap 3. 13 14 * Adapt exporters and batch processors to customized interfaces. 15 16 * Use kofa-scrollto script. 17 18 1.1 (2014-03-14) 19 ================ 20 21 * Back-to links replaced by animated jQuery plugins. 22 23 * jquery-ui.min.js is also used for tooltips. 24 25 * Refer to INSTALL.txt in waeup.kofa sources. 26 27 * Use only https in theme.html. 28 29 * Removed sphinx docs. 30 31 * Added generic install instructions. 32 33 * Removed README in src/. 34 35 36 1.0 (2014-02-22) 37 ================ 38 39 * Diazofied complete package. 40 41 42 0.1 (2014-02-21) 4 0.1 (2014-06-16) 43 5 ================ 44 6 -
main/kofacustom.sampleuni/trunk/README.txt
r11428 r11687 1 waeup.s keleton2 ************** 1 waeup.sampleuni 2 *************** 3 3 4 `waeup.s keleton` is a Python package providing a student information4 `waeup.sampleuni` is a Python package providing a student information 5 5 portal based on WAeUP Kofa. 6 6 … … 14 14 The Subversion_ repository location of this package is 15 15 16 https://svn.waeup.org/repos/main/waeup.s keleton/16 https://svn.waeup.org/repos/main/waeup.sampleuni/ 17 17 18 18 .. _Subversion: http://subversion.apache.org/ -
main/kofacustom.sampleuni/trunk/buildout-zeo.cfg
r11394 r11687 118 118 # See http://pypi.python.org/pypi/zc.recipe.egg for details... 119 119 recipe = zc.recipe.egg 120 eggs = kofacustom.s keleton[beaker, diazo]120 eggs = kofacustom.sampleuni [beaker, diazo] 121 121 arguments = "${buildout:parts-directory}/etc/zeo1.conf" 122 122 scripts = kofactl=zeo_client1 … … 125 125 # See http://pypi.python.org/pypi/zc.recipe.egg for details... 126 126 recipe = zc.recipe.egg 127 eggs = kofacustom.s keleton[beaker, diazo]127 eggs = kofacustom.sampleuni [beaker, diazo] 128 128 arguments = "${buildout:parts-directory}/etc/zeo2.conf" 129 129 scripts = kofactl=zeo_client2 -
main/kofacustom.sampleuni/trunk/buildout.cfg
r11518 r11687 2 2 # See http://pypi.python.org/pypi/mr.developer for details 3 3 extensions = mr.developer 4 auto-checkout = waeup.kofa kofacustom.nigeria 4 # Install waeup.kofa as develop egg 5 auto-checkout = waeup.kofa 5 6 # We cannot use 'src' (the default) as the checked out projects won't 6 7 # work properly with paster (paster looks up any upper directory … … 45 46 [sources] 46 47 waeup.kofa = svn https://svn.waeup.org/repos/main/waeup.kofa/trunk 47 kofacustom.nigeria = svn https://svn.waeup.org/repos/main/kofacustom.nigeria/trunk48 48 49 49 [kofa_params] … … 66 66 # number of preopened paster threads, default 10 67 67 threadpool_workers = 10 68 devel_pkg = kofacustom.s keleton68 devel_pkg = kofacustom.sampleuni 69 69 70 70 [app] 71 71 # This creates all scripts in bin/. The kofactl created here is 'faulty'. 72 72 recipe = zc.recipe.egg 73 eggs = kofacustom.s keleton[beaker, diazo]73 eggs = kofacustom.sampleuni [beaker, diazo] 74 74 z3c.evalexception>=2.0 75 75 Paste … … 85 85 # fixed path to zdaemon.conf as argument. 86 86 recipe = zc.recipe.egg 87 eggs = kofacustom.s keleton[beaker, diazo]87 eggs = kofacustom.sampleuni [beaker, diazo] 88 88 arguments = "${buildout:parts-directory}/etc/zdaemon.conf" 89 89 scripts = kofactl=kofactl … … 100 100 [test] 101 101 recipe = zc.recipe.testrunner 102 eggs = kofacustom.s keleton[beaker, test]102 eggs = kofacustom.sampleuni [beaker, test] 103 103 defaults = ['--tests-pattern', '^f?tests$', '-v'] 104 104 … … 106 106 [i18n] 107 107 recipe = z3c.recipe.i18n:i18n 108 packages = kofacustom.s keleton109 eggs = kofacustom.s keleton110 domain = kofacustom.s keleton111 output = src/kofacustom/s keleton/locales108 packages = kofacustom.sampleuni 109 eggs = kofacustom.sampleuni 110 domain = kofacustom.sampleuni 111 output = src/kofacustom/sampleuni/locales 112 112 zcml = 113 113 … … 116 116 [zpasswd] 117 117 recipe = z3c.recipe.dev:script 118 eggs = kofacustom.s keleton118 eggs = kofacustom.sampleuni 119 119 module = zope.app.server.zpasswd 120 120 method = main … … 184 184 [coverage-detect] 185 185 recipe = zc.recipe.testrunner 186 eggs = kofacustom.s keleton[beaker]186 eggs = kofacustom.sampleuni[beaker] 187 187 defaults = ['--tests-pattern', '^f?tests$', '-v', '--coverage', 'coverage'] 188 188 … … 205 205 diazo [wsgi] 206 206 PasteScript 207 kofacustom.s keleton[beaker, diazo]207 kofacustom.sampleuni [beaker, diazo] -
main/kofacustom.sampleuni/trunk/etc/site.zcml.in
r10765 r11687 1 1 <configure xmlns="http://namespaces.zope.org/zope" 2 2 xmlns:kofa="http://namespaces.waeup.org/kofa" 3 i18n_domain="kofacustom.s keleton">3 i18n_domain="kofacustom.sampleuni"> 4 4 5 <include package="kofacustom.s keleton" />6 <include package="kofacustom.s keleton" file="mail.zcml" />5 <include package="kofacustom.sampleuni" /> 6 <include package="kofacustom.sampleuni" file="mail.zcml" /> 7 7 8 8 <!-- install job container … … 29 29 path="${buildout:directory}/var/datacenter" /> 30 30 31 <configure i18n_domain="kofacustom.s keleton">31 <configure i18n_domain="kofacustom.sampleuni"> 32 32 33 33 <unauthenticatedPrincipal id="zope.anybody" -
main/kofacustom.sampleuni/trunk/setup.py
r11518 r11687 10 10 'grokcore.startup', 11 11 'waeup.kofa >= 1.1', 12 'kofacustom.nigeria >= 1.0',13 12 ], 14 13 … … 47 46 ) 48 47 49 setup(name = 'kofacustom.s keleton',48 setup(name = 'kofacustom.sampleuni', 50 49 version = version, 51 50 description = "A customized waeup.kofa", -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/applicant.py
r10765 r11687 21 21 from waeup.kofa.applicants.applicant import ApplicantFactory 22 22 from waeup.kofa.utils.helpers import attrs_to_fields 23 from kofacustom.nigeria.applicants.applicant import NigeriaApplicant24 from kofacustom.s keleton.applicants.interfaces import(25 ICustomApplicant, ICustom UGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit)23 from waeup.kofa.applicants.applicant import Applicant 24 from kofacustom.sampleuni.applicants.interfaces import( 25 ICustomApplicant, ICustomApplicantEdit) 26 26 27 class CustomApplicant( NigeriaApplicant):27 class CustomApplicant(Applicant): 28 28 29 grok.implements(ICustomApplicant, ICustomUGApplicantEdit, 30 ICustomPGApplicantEdit, IPUTMEApplicantEdit) 29 grok.implements(ICustomApplicant, ICustomApplicantEdit) 31 30 grok.provides(ICustomApplicant) 32 31 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/batching.py
r11543 r11687 20 20 from waeup.kofa.utils.batching import BatchProcessor 21 21 from waeup.kofa.applicants.batching import ApplicantProcessor 22 from kofacustom.skeleton.applicants.interfaces import ( 23 ICustomApplicant, ICustomApplicantUpdateByRegNo) 22 from kofacustom.sampleuni.applicants.interfaces import ICustomApplicant 24 23 25 24 class CustomApplicantProcessor(ApplicantProcessor): … … 36 35 """ 37 36 iface = ICustomApplicant 38 iface_byregnumber = ICustomApplicantUpdateByRegNo -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/browser.py
r10765 r11687 21 21 from waeup.kofa.applicants.browser import ( 22 22 ApplicantRegistrationPage, ApplicantsContainerPage) 23 from kofacustom.nigeria.applicants.browser import ( 24 NigeriaApplicantDisplayFormPage, 25 NigeriaPDFApplicationSlip) 23 from kofacustom.sampleuni.interfaces import MessageFactory as _ 26 24 27 from kofacustom.skeleton.interfaces import MessageFactory as _28 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/export.py
r11543 r11687 20 20 import grok 21 21 from waeup.kofa.applicants.interfaces import IApplicantBaseData 22 from kofacustom.nigeria.applicants.export import NigeriaApplicantsExporter 23 from kofacustom.nigeria.applicants.interfaces import ( 24 INigeriaUGApplicant, INigeriaPGApplicant) 25 from kofacustom.skeleton.applicants.interfaces import ( 26 ICustomUGApplicant, ICustomPGApplicant) 22 from waeup.kofa.applicants.export import ApplicantsExporter 23 from kofacustom.sampleuni.applicants.interfaces import ICustomApplicant 27 24 28 class CustomApplicantsExporter( NigeriaApplicantsExporter):25 class CustomApplicantsExporter(ApplicantsExporter): 29 26 """Exporter for Custom Applicants. 30 27 """ 31 28 32 29 fields = tuple(sorted(set( 33 ICustomUGApplicant.names() + 34 ICustomPGApplicant.names() + 35 INigeriaUGApplicant.names() + 36 INigeriaPGApplicant.names() + 30 ICustomApplicant.names() + 37 31 IApplicantBaseData.names() 38 32 ))) + ('container_code',) -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/interfaces.py
r10765 r11687 19 19 """ 20 20 21 from zope import schema22 21 from waeup.kofa.applicants.interfaces import ( 23 22 IApplicantBaseData, 24 AppCatCertificateSource, CertificateSource) 25 from waeup.kofa.schoolgrades import ResultEntryField 26 from waeup.kofa.interfaces import ( 27 SimpleKofaVocabulary, academic_sessions_vocab, validate_email) 28 from waeup.kofa.schema import FormattedDate, TextLineChoice 29 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source 31 from kofacustom.nigeria.applicants.interfaces import ( 32 LGASource, high_qual, high_grade, exam_types, 33 INigeriaUGApplicant, INigeriaPGApplicant, 34 INigeriaApplicantOnlinePayment, 35 INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, 36 INigeriaApplicantUpdateByRegNo, 37 IPUTMEApplicantEdit, 23 IApplicantOnlinePayment, 24 IApplicantEdit, 38 25 ) 39 from kofacustom.skeleton.interfaces import MessageFactory as _ 40 from kofacustom.skeleton.payments.interfaces import ICustomOnlinePayment 26 from kofacustom.sampleuni.interfaces import MessageFactory as _ 41 27 42 class ICustom UGApplicant(INigeriaUGApplicant):43 """A n undergraduateapplicant.28 class ICustomApplicant(IApplicantBaseData): 29 """A custom applicant. 44 30 45 This interface defines the least common multiple of all fields46 in ug application forms. In customized forms, fields can be excluded by47 adding them to the UG_OMIT* tuples.48 31 """ 49 32 50 class ICustomPGApplicant(INigeriaPGApplicant): 51 """A postgraduate applicant. 52 53 This interface defines the least common multiple of all fields 54 in pg application forms. In customized forms, fields can be excluded by 55 adding them to the PG_OMIT* tuples. 56 """ 57 58 59 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant): 60 """An interface for both types of applicants. 61 62 Attention: The ICustomPGApplicant field seetings will be overwritten 63 by ICustomPGApplicant field settings. If a field is defined 64 in both interfaces zope.schema validates only against the 65 constraints in ICustomUGApplicant. This does not affect the forms 66 since they are build on either ICustomUGApplicant or ICustomPGApplicant. 67 """ 68 69 def writeLogMessage(view, comment): 70 """Adds an INFO message to the log file 71 """ 72 73 def createStudent(): 74 """Create a student object from applicant data 75 and copy applicant object. 76 """ 77 78 class ICustomUGApplicantEdit(INigeriaUGApplicantEdit): 79 """An undergraduate applicant interface for edit forms. 33 class ICustomApplicantEdit(IApplicantEdit): 34 """A custom applicant interface for editing. 80 35 81 36 Here we can repeat the fields from base data and set the … … 88 43 """ 89 44 90 class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): 91 """A postgraduate applicant interface for editing. 92 93 Here we can repeat the fields from base data and set the 94 `required` and `readonly` attributes to True to further restrict 95 the data access. Or we can allow only certain certificates to be 96 selected by choosing the appropriate source. 97 98 We cannot omit fields here. This has to be done in the 99 respective form page. 100 """ 101 102 class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): 103 """An applicant payment via payment gateways. 45 class ICustomApplicantOnlinePayment(IApplicantOnlinePayment): 46 """A custom applicant payment via payment gateways. 104 47 105 48 """ 106 49 107 class IPUTMEApplicantEdit(IPUTMEApplicantEdit):108 """An undergraduate applicant interface for editing.109 110 Here we can repeat the fields from base data and set the111 `required` and `readonly` attributes to True to further restrict112 the data access. Or we can allow only certain certificates to be113 selected by choosing the appropriate source.114 115 We cannot omit fields here. This has to be done in the116 respective form page.117 """118 119 class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):120 """Representation of an applicant.121 122 Skip regular reg_number validation if reg_number is used for finding123 the applicant object.124 """ -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/payment.py
r10765 r11687 24 24 from waeup.kofa.applicants.payment import ApplicantOnlinePayment 25 25 from waeup.kofa.utils.helpers import attrs_to_fields 26 from kofacustom.s keleton.applicants.interfaces import ICustomApplicantOnlinePayment26 from kofacustom.sampleuni.applicants.interfaces import ICustomApplicantOnlinePayment 27 27 28 28 class CustomApplicantOnlinePayment(ApplicantOnlinePayment): -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_applicant.py
r10765 r11687 30 30 from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser 31 31 from waeup.kofa.testing import FunctionalTestCase 32 from kofacustom.s keleton.applicants.applicant import (32 from kofacustom.sampleuni.applicants.applicant import ( 33 33 CustomApplicant, CustomApplicantFactory, 34 34 ) 35 from kofacustom.s keleton.applicants.interfaces import ICustomApplicant36 from kofacustom.s keleton.testing import FunctionalLayer35 from kofacustom.sampleuni.applicants.interfaces import ICustomApplicant 36 from kofacustom.sampleuni.testing import FunctionalLayer 37 37 38 38 class CustomApplicantTest(FunctionalTestCase): -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_browser.py
r11543 r11687 24 24 from zope.catalog.interfaces import ICatalog 25 25 from zope.intid.interfaces import IIntIds 26 from kofacustom.skeleton.testing import FunctionalLayer 26 from kofacustom.sampleuni.testing import FunctionalLayer 27 from waeup.kofa.schoolgrades import ResultEntry 28 from waeup.kofa.utils.utils import KofaUtils 27 29 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 28 30 from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup 29 from kofacustom.s keleton.applicants.export import CustomApplicantsExporter30 from kofacustom.s keleton.applicants.batching import CustomApplicantProcessor31 from kofacustom.sampleuni.applicants.export import CustomApplicantsExporter 32 from kofacustom.sampleuni.applicants.batching import CustomApplicantProcessor 31 33 32 34 class CustomApplicantUITests(ApplicantsFullSetup): … … 53 55 applicant.lastname = u'Tester' 54 56 applicant.middlename = u'M.' 55 applicant.nationality = u'NG'56 57 applicant.date_of_birth = datetime.date(1981, 2, 4) 57 58 applicant.sex = 'f' … … 62 63 applicant.course_admitted = self.certificate 63 64 applicant.notice = u'Some notice\nin lines.' 64 applicant.screening_score = 9865 applicant.screening_venue = u'Exam Room'66 applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM'67 65 applicant.password = 'any password' 66 result_entry = ResultEntry( 67 KofaUtils.EXAM_SUBJECTS_DICT.keys()[0], 68 KofaUtils.EXAM_GRADES[0][0] 69 ) 70 applicant.school_grades = [ 71 result_entry] 68 72 return applicant 69 73 … … 75 79 exporter.export_all(self.app, self.outfile) 76 80 result = open(self.outfile, 'rb').read() 77 self.assertMatches(result, 78 'aggregate,applicant_id,application_date,application_number,' 79 'course1,course2,course_admitted,date_of_birth,display_fullname,' 80 'email,emp2_end,emp2_position,emp2_reason,emp2_start,emp_end,' 81 'emp_position,emp_reason,emp_start,employer,employer2,' 82 'firstname,history,hq_degree,hq_disc,hq_matric_no,hq_school,' 83 'hq_session,hq_type,jamb_score,jamb_subjects,lastname,lga,' 84 'locked,middlename,nationality,notice,nysc_lga,nysc_year,' 85 'password,phone,pp_school,presently_inst,reg_number,' 86 'result_uploaded,screening_date,screening_score,' 87 'screening_venue,sex,special_application,' 88 'state,student_id,suspended,container_code\r\n' 89 ',dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,' 90 'Anna M. Tester,anna@sample.com,,,,,,,,,,,Anna,' 91 '[u\'2012-10-28 21:27:52 WAT - Application initialized by system\']' 92 ',,,,,,,,,Tester,,0,M.,NG,"Some notice\nin lines.",,,' 93 'any password,+234-123-12345#,,,123456,,' 94 '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,initialized,,' 95 '0,dp2011\r\n') 81 self.assertTrue( 82 'applicant_id,application_date,application_number,course1,course2,' 83 'course_admitted,date_of_birth,display_fullname,email,firstname,' 84 'history,lastname,locked,middlename,notice,password,phone,' 85 'reg_number,sex,special_application,state,' 86 'student_id,suspended,container_code\r\n' 87 'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,' 88 'Anna M. Tester,anna@sample.com,Anna,' 89 in result) 90 self.assertTrue( 91 'Application initialized by system\'],' 92 'Tester,0,M.,"Some notice\nin lines.",any password,' 93 '+234-123-12345#,123456,f,,initialized,,0,dp2011\r\n' 94 in result) 96 95 # We can import the same file if we ignore some columns. 97 96 # Since the applicants_catalog hasn't been notified, the same … … 100 99 result = processor.doImport( 101 100 self.outfile, 102 [' aggreagate','ignore_applicant_id','application_date',101 ['ignore_applicant_id','application_date', 103 102 'ignore_application_number','course1','course2', 104 'course_admitted','date_of_birth','ignore3','email','emp2_end', 105 'emp2_position','emp2_reason','emp2_start','emp_end','emp_position', 106 'emp_reason','emp_start','employer','employer2','firstname','ignore4', 107 'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type', 108 'jamb_score','jamb_subjects','lastname','lga','locked','middlename', 109 'nationality','notice','nysc_lga', 110 'nysc_year','password','phone','pp_school','presently_inst', 111 'reg_number','result_uploaded', 112 'screening_date','screening_score','screening_venue','sex', 113 'special_application', 114 'state','student_id','suspended','container_code'], 103 'course_admitted','date_of_birth', 104 'ignore_display_fullname','email','firstname', 105 'ignore_history','lastname','locked','middlename', 106 'notice','password','phone', 107 'reg_number','sex','special_application','state', 108 'student_id','suspended','container_code'], 115 109 mode='create') 116 110 num_succ, num_fail, finished_path, failed_path = result … … 118 112 self.assertEqual(num_succ,1) 119 113 self.assertEqual(num_fail,0) 120 # Now we ignore also the container_code and import the same file121 # in update mode which means that INigeriaApplicantUpdateByRegNo122 # is used for field conversion. applicant_id must be ignored123 # too since the previous import has notified the applicants_catalog124 # so that the portal 'knows' that reg_number is in use.125 processor = CustomApplicantProcessor()126 result = processor.doImport(127 self.outfile,128 ['aggregate','ignore_applicant_id','application_date',129 'ignore_application_number','course1','course2',130 'course_admitted','date_of_birth','ignore3','email','emp2_end',131 'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',132 'emp_reason','emp_start','employer','employer2','firstname','ignore4',133 'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type',134 'jamb_score','jamb_subjects','lastname','lga','locked','middlename',135 'nationality','notice','nysc_lga',136 'nysc_year','password','phone','pp_school','presently_inst',137 'reg_number','result_uploaded','screening_date','screening_score',138 'screening_venue','sex','special_application',139 'state','student_id','suspended','ignore_container_code'],140 mode='update')141 num_succ, num_fail, finished_path, failed_path = result142 self.assertEqual(num_succ,1)143 self.assertEqual(num_fail,0)144 114 return -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/utils.py
r10765 r11687 19 19 """ 20 20 21 from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils 22 from waeup.kofa.applicants.workflow import (INITIALIZED, 23 STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED) 24 from kofacustom.skeleton.interfaces import MessageFactory as _ 21 from waeup.kofa.applicants.utils import ApplicantsUtils 22 from kofacustom.sampleuni.interfaces import MessageFactory as _ 25 23 26 27 28 class ApplicantsUtils(NigeriaApplicantsUtils): 24 class ApplicantsUtils(ApplicantsUtils): 29 25 """A collection of parameters and methods subject to customization. 30 26 """ -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/browser/pages.py
r10765 r11687 21 21 LoginPage, CertificatePage, CertificateManageFormPage) 22 22 from waeup.kofa.university.interfaces import ICertificate 23 from kofacustom.s keleton.interfaces import (23 from kofacustom.sampleuni.interfaces import ( 24 24 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 25 25 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/browser/tests.py
r11272 r11687 22 22 from zope.security.interfaces import Unauthorized 23 23 from waeup.kofa.testing import FunctionalTestCase 24 from kofacustom.s keleton.testing import FunctionalLayer24 from kofacustom.sampleuni.testing import FunctionalLayer 25 25 from waeup.kofa.app import University 26 26 … … 48 48 clearSite() 49 49 shutil.rmtree(self.dc_root) 50 51 def test_access_live_url(self):52 # We can't access the system with basic authentication53 self.browser.addHeader('Authorization', 'Basic grok:grok')54 self.assertRaises(55 Unauthorized, self.browser.open, 'https://skeleton-kofa.waeup.org')56 return -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/configuration.py
r10765 r11687 24 24 from waeup.kofa.configuration import ( 25 25 SessionConfigurationFactory, SessionConfiguration) 26 from kofacustom.s keleton.interfaces import (26 from kofacustom.sampleuni.interfaces import ( 27 27 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 28 28 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/configure.zcml
r10765 r11687 1 1 <configure xmlns="http://namespaces.zope.org/zope" 2 2 xmlns:grok="http://namespaces.zope.org/grok"> 3 <include package="kofacustom.s keleton" file="locales.zcml" />3 <include package="kofacustom.sampleuni" file="locales.zcml" /> 4 4 5 <!-- kofacustom.nigeria configures everything we basically need. 6 --> 7 <include package="kofacustom.nigeria" /> 8 5 <include package="waeup.kofa" /> 9 6 <grok:grok package="." /> 10 7 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/ftesting.zcml
r10765 r11687 2 2 xmlns="http://namespaces.zope.org/zope" 3 3 xmlns:kofa="http://namespaces.waeup.org/kofa" 4 i18n_domain="kofacustom.s keleton"5 package="kofacustom.s keleton"4 i18n_domain="kofacustom.sampleuni" 5 package="kofacustom.sampleuni" 6 6 > 7 7 8 <include package="kofacustom.s keleton" />9 <include package="kofacustom.s keleton" file="mail.zcml"/>8 <include package="kofacustom.sampleuni" /> 9 <include package="kofacustom.sampleuni" file="mail.zcml"/> 10 10 11 11 <!-- Where should the datacenter reside by default? --> -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/interfaces.py
r10765 r11687 23 23 ISessionConfiguration, academic_sessions_vocab) 24 24 25 _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.s keleton')25 _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.sampleuni') 26 26 27 27 # It's recommended to replicate all fields from the base package here. -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/payments/interfaces.py
r10765 r11687 18 18 from zope.interface import Attribute 19 19 from zope import schema 20 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment21 from kofacustom.s keleton.interfaces import MessageFactory as _20 from waeup.kofa.payments.interfaces import IOnlinePayment 21 from kofacustom.sampleuni.interfaces import MessageFactory as _ 22 22 23 class ICustomOnlinePayment(I NigeriaOnlinePayment):23 class ICustomOnlinePayment(IOnlinePayment): 24 24 """A payment via payment gateways. 25 25 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/permissions.py
r10765 r11687 20 20 21 21 22 class C RPUOfficer(CCOfficer):22 class CustomCCOfficer(CCOfficer): 23 23 """ Permissions of Computer Center members. 24 24 … … 28 28 29 29 grok.name('waeup.CCOfficer') 30 grok.title(u' CC Officer')30 grok.title(u'Our CC Officer') -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/batching.py
r10765 r11687 24 24 students, studycourses, payment tickets and accommodation tickets. 25 25 """ 26 from kofacustom.s keleton.students.interfaces import (26 from kofacustom.sampleuni.students.interfaces import ( 27 27 ICustomStudent, ICustomStudentUpdateByRegNo, 28 28 ICustomStudentUpdateByMatricNo, -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/browser.py
r10765 r11687 32 32 from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket 33 33 from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS 34 from kofacustom.nigeria.students.browser import ( 35 NigeriaOnlinePaymentDisplayFormPage, 36 NigeriaStudentBaseManageFormPage, 37 NigeriaStudentClearanceEditFormPage, 38 NigeriaOnlinePaymentAddFormPage, 39 NigeriaExportPDFPaymentSlipPage, 40 NigeriaExportPDFClearanceSlipPage, 41 ) 42 43 from kofacustom.skeleton.students.interfaces import ( 34 from kofacustom.sampleuni.students.interfaces import ( 44 35 ICustomStudentOnlinePayment, ICustomStudentStudyCourse, 45 36 ICustomStudentStudyLevel) 46 from kofacustom.s keleton.interfaces import MessageFactory as _37 from kofacustom.sampleuni.interfaces import MessageFactory as _ 47 38 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/export.py
r11545 r11687 18 18 """Exporters for student related stuff. 19 19 """ 20 from kofacustom.s keleton.students.interfaces import (20 from kofacustom.sampleuni.students.interfaces import ( 21 21 ICustomStudent, 22 22 ICustomStudentStudyCourse, … … 24 24 ICustomCourseTicket, 25 25 ICustomStudentOnlinePayment) 26 from kofacustom.nigeria.students.export import (27 NigeriaStudentsExporter,28 NigeriaStudentStudyCourseExporter,29 NigeriaStudentStudyLevelExporter,30 NigeriaCourseTicketExporter,31 NigeriaStudentPaymentsExporter)26 from waeup.kofa.students.export import ( 27 StudentsExporter, 28 StudentStudyCourseExporter, 29 StudentStudyLevelExporter, 30 CourseTicketExporter, 31 StudentPaymentsExporter) 32 32 from waeup.kofa.utils.helpers import iface_names 33 33 34 class CustomStudentsExporter( NigeriaStudentsExporter):34 class CustomStudentsExporter(StudentsExporter): 35 35 """Exporter for Students. 36 36 """ … … 41 41 'current_level', 'current_session') 42 42 43 class CustomStudentStudyCourseExporter( NigeriaStudentStudyCourseExporter):43 class CustomStudentStudyCourseExporter(StudentStudyCourseExporter): 44 44 """Exporter for StudentStudyCourses. 45 45 """ … … 48 48 sorted(iface_names(ICustomStudentStudyCourse))) + ('student_id',) 49 49 50 class CustomStudentStudyLevelExporter( NigeriaStudentStudyLevelExporter):50 class CustomStudentStudyLevelExporter(StudentStudyLevelExporter): 51 51 """Exporter for StudentStudyLevels. 52 52 """ … … 56 56 'student_id', 'number_of_tickets','certcode') 57 57 58 class CustomCourseTicketExporter( NigeriaCourseTicketExporter):58 class CustomCourseTicketExporter(CourseTicketExporter): 59 59 """Exporter for CourseTickets. 60 60 """ … … 64 64 'certcode', 'display_fullname') 65 65 66 class CustomStudentPaymentsExporter( NigeriaStudentPaymentsExporter):66 class CustomStudentPaymentsExporter(StudentPaymentsExporter): 67 67 """Exporter for OnlinePayment instances. 68 68 """ -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/interfaces.py
r10765 r11687 18 18 19 19 from zope import schema 20 from kofacustom.nigeria.students.interfaces import (21 I NigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,22 I NigeriaStudentPersonal, INigeriaStudentStudyLevel,23 I NigeriaStudentStudyCourse, INigeriaCourseTicket,24 I NigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,20 from waeup.kofa.students.interfaces import ( 21 IStudentBase, IUGStudentClearance, IPGStudentClearance, 22 IStudentPersonal, IStudentStudyLevel, 23 IStudentStudyCourse, ICourseTicket, 24 IStudentUpdateByRegNo, IStudentUpdateByMatricNo, 25 25 ) 26 from kofacustom.s keleton.payments.interfaces import ICustomOnlinePayment27 from kofacustom.s keleton.interfaces import MessageFactory as _26 from kofacustom.sampleuni.payments.interfaces import ICustomOnlinePayment 27 from kofacustom.sampleuni.interfaces import MessageFactory as _ 28 28 29 class ICustomStudentBase(I NigeriaStudentBase):29 class ICustomStudentBase(IStudentBase): 30 30 """Representation of student base data. 31 31 32 32 """ 33 33 34 class ICustomStudentPersonal(I NigeriaStudentPersonal):34 class ICustomStudentPersonal(IStudentPersonal): 35 35 """Student personal data. 36 36 37 37 """ 38 38 39 class ICustomUGStudentClearance(I NigeriaUGStudentClearance):39 class ICustomUGStudentClearance(IUGStudentClearance): 40 40 """Representation of ug student clearance data. 41 41 42 42 """ 43 43 44 class ICustomPGStudentClearance(I NigeriaPGStudentClearance):44 class ICustomPGStudentClearance(IPGStudentClearance): 45 45 """Representation of pg student clearance data. 46 46 … … 54 54 """ 55 55 56 class ICustomStudentStudyCourse(I NigeriaStudentStudyCourse):56 class ICustomStudentStudyCourse(IStudentStudyCourse): 57 57 """A container for student study levels. 58 58 59 59 """ 60 60 61 class ICustomStudentStudyLevel(I NigeriaStudentStudyLevel):61 class ICustomStudentStudyLevel(IStudentStudyLevel): 62 62 """A container for course tickets. 63 63 … … 85 85 'p_session'].order 86 86 87 class ICustomCourseTicket(I NigeriaCourseTicket):87 class ICustomCourseTicket(ICourseTicket): 88 88 """A course ticket. 89 89 90 90 """ 91 91 92 class ICustomStudentUpdateByRegNo(I NigeriaStudentUpdateByRegNo):92 class ICustomStudentUpdateByRegNo(IStudentUpdateByRegNo): 93 93 """Representation of a student. Skip regular reg_number validation. 94 94 95 95 """ 96 96 97 class ICustomStudentUpdateByMatricNo(I NigeriaStudentUpdateByMatricNo):97 class ICustomStudentUpdateByMatricNo(IStudentUpdateByMatricNo): 98 98 """Representation of a student. Skip regular matric_number validation. 99 99 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/payments.py
r10765 r11687 26 26 StudentOnlinePayment, StudentOnlinePaymentFactory) 27 27 from waeup.kofa.utils.helpers import attrs_to_fields 28 from kofacustom.s keleton.students.interfaces import ICustomStudentOnlinePayment28 from kofacustom.sampleuni.students.interfaces import ICustomStudentOnlinePayment 29 29 30 30 class CustomStudentOnlinePayment(StudentOnlinePayment): -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/student.py
r10765 r11687 25 25 from waeup.kofa.students.interfaces import IStudentNavigation 26 26 from waeup.kofa.utils.helpers import get_current_principal 27 from kofacustom.nigeria.students.student import NigeriaStudent28 from kofacustom.s keleton.students.interfaces import ICustomStudent27 from waeup.kofa.students.student import Student 28 from kofacustom.sampleuni.students.interfaces import ICustomStudent 29 29 30 30 31 class CustomStudent( NigeriaStudent):31 class CustomStudent(Student): 32 32 """This is a student container for the various objects 33 33 owned by students. … … 39 39 def transcript_enabled(self): 40 40 user = get_current_principal() 41 if user.id in ('admin' , 'isouaba', 'niyi', 'delejason'):41 if user.id in ('admin'): 42 42 return True 43 43 return False -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/studycourse.py
r10765 r11687 26 26 from waeup.kofa.students.interfaces import IStudentNavigation 27 27 from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID 28 from kofacustom.nigeria.students.studycourse import NigeriaStudentStudyCourse29 from kofacustom.s keleton.students.interfaces import ICustomStudentStudyCourse28 from waeup.kofa.students.studycourse import StudentStudyCourse 29 from kofacustom.sampleuni.students.interfaces import ICustomStudentStudyCourse 30 30 31 class CustomStudentStudyCourse( NigeriaStudentStudyCourse):31 class CustomStudentStudyCourse(StudentStudyCourse): 32 32 """This is a container for study levels. 33 33 """ -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/studylevel.py
r10765 r11687 28 28 CourseTicketFactory, StudentStudyLevelFactory) 29 29 from waeup.kofa.students.interfaces import IStudentNavigation 30 from kofacustom.s keleton.students.interfaces import (30 from kofacustom.sampleuni.students.interfaces import ( 31 31 ICustomStudentStudyLevel, ICustomCourseTicket) 32 32 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_browser.py
r10765 r11687 34 34 IExtFileStore, IFileStoreNameChooser) 35 35 from waeup.kofa.students.interfaces import IStudentsUtils 36 from kofacustom.s keleton.testing import FunctionalLayer36 from kofacustom.sampleuni.testing import FunctionalLayer 37 37 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_export.py
r11543 r11687 5 5 from waeup.kofa.schoolgrades import ResultEntry 6 6 from waeup.kofa.students.tests.test_batching import StudentImportExportSetup 7 from kofacustom.s keleton.utils.utils import CustomKofaUtils8 from kofacustom.s keleton.students.export import (7 from kofacustom.sampleuni.utils.utils import CustomKofaUtils 8 from kofacustom.sampleuni.students.export import ( 9 9 CustomStudentsExporter, CustomStudentPaymentsExporter) 10 from kofacustom.s keleton.testing import FunctionalLayer10 from kofacustom.sampleuni.testing import FunctionalLayer 11 11 12 12 … … 46 46 result = open(self.outfile, 'rb').read() 47 47 self.assertMatches( 48 'adm_code,alr_date,alr_fname,alr_no,alr_results,clearance_locked,' 49 'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,' 50 'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,' 51 'emp_reason,emp_start,employer,employer2,firstname,former_matric,' 52 'fst_sit_date,fst_sit_fname,fst_sit_no,fst_sit_results,' 53 'fst_sit_type,hq2_degree,hq2_disc,hq2_matric_no,hq2_school,' 54 'hq2_session,hq2_type,hq_degree,hq_disc,hq_fname,hq_matric_no,' 55 'hq_school,hq_session,hq_type,is_staff,lastname,lga,' 56 'marit_stat,matric_number,middlename,nationality,' 57 'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,' 58 'nysc_lga,nysc_location,nysc_year,officer_comment,' 59 'perm_address,personal_updated,phone,reg_number,' 60 'religion,scd_sit_date,scd_sit_fname,scd_sit_no,' 61 'scd_sit_results,scd_sit_type,sex,student_id,' 62 'suspended,suspended_comment,password,state,history,certcode,is_postgrad,' 63 'current_level,current_session\r\nmy adm code,,,,' 64 '"[(\'visual_art\', \'A1\')]",0,my clr code,1981-02-04#,,,' 65 'anna@sample.com,,,,,,,,,,,Anna,,,,,"[(\'visual_art\', \'A1\')]"' 66 ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,' 67 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,,,,,' 68 '"[(\'visual_art\', \'A1\')]",,f,A111111,0,,,created,' 69 '[u\'2012-11-06 13:16:41 WAT - Record created by system\'],' 48 'adm_code,clearance_locked,clr_code,date_of_birth,email,' 49 'employer,firstname,lastname,matric_number,middlename,' 50 'nationality,officer_comment,perm_address,personal_updated,' 51 'phone,reg_number,sex,student_id,suspended,suspended_comment,' 52 'password,state,history,certcode,is_postgrad,current_level,' 53 'current_session\r\nmy adm code,0,my clr code,1981-02-04#,' 54 'anna@sample.com,,Anna,Tester,234,M.,NG,,' 55 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,' 56 'f,A111111,0,,,created,' 57 '[u\'2014-06-16 08:23:55 UTC - Record created by system\'],' 70 58 'CERT1,0,200,2012\r\n', 71 59 result … … 99 87 result = open(self.outfile, 'rb').read() 100 88 self.assertMatches( 101 'ac,amount_auth,creation_date,gateway_amt,p_category,p_current,' 102 'p_id,p_item,p_level,p_session,p_state,payment_date,provider_amt,' 103 'r_amount_approved,r_card_num,r_code,r_company,r_desc,' 104 'r_pay_reference,thirdparty_amt,student_id,state,' 105 'current_session\r\n' 106 '666,12.12,2012-04-01 13:12:01,,schoolfee,1,my-id,p-item,' 107 '100,2012,paid,2012-04-01 14:12:01,,12.12,' 108 '789,r-code,interswatch,,,,A111111,created,2012\r\n', 89 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 90 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 91 'r_code,r_desc,student_id,state,current_session\r\n666,' 92 '12.12,2012-04-01 13:12:01,schoolfee,1,my-id,p-item,' 93 '100,2012,paid,2012-04-01 14:12:01,12.12,r-code,,' 94 'A111111,created,2012\r\n', 109 95 result 110 96 ) -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_student.py
r10765 r11687 22 22 from zope.interface import verify 23 23 from waeup.kofa.testing import FunctionalTestCase 24 from kofacustom.s keleton.students.student import CustomStudent, CustomStudentFactory25 from kofacustom.s keleton.students.studycourse import (24 from kofacustom.sampleuni.students.student import CustomStudent, CustomStudentFactory 25 from kofacustom.sampleuni.students.studycourse import ( 26 26 CustomStudentStudyCourse, CustomStudentStudyCourseFactory) 27 from kofacustom.s keleton.students.studylevel import (27 from kofacustom.sampleuni.students.studylevel import ( 28 28 CustomStudentStudyLevel, CustomCourseTicket, 29 29 CustomStudentStudyLevelFactory, 30 30 CustomCourseTicketFactory) 31 from kofacustom.s keleton.students.interfaces import (31 from kofacustom.sampleuni.students.interfaces import ( 32 32 ICustomStudent, ICustomStudentStudyCourse, 33 33 ICustomStudentStudyLevel, ICustomCourseTicket) 34 from kofacustom.s keleton.testing import FunctionalLayer34 from kofacustom.sampleuni.testing import FunctionalLayer 35 35 36 36 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/utils.py
r10765 r11687 20 20 from waeup.kofa.interfaces import (IKofaUtils, 21 21 CLEARED, RETURNING, PAID, REGISTERED, VALIDATED) 22 from kofacustom.nigeria.students.utils import NigeriaStudentsUtils23 from kofacustom.s keleton.interfaces import MessageFactory as _22 from waeup.kofa.students.utils import StudentsUtils 23 from kofacustom.sampleuni.interfaces import MessageFactory as _ 24 24 25 class CustomStudentsUtils( NigeriaStudentsUtils):25 class CustomStudentsUtils(StudentsUtils): 26 26 """A collection of customized methods. 27 27 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/viewlets.py
r10765 r11687 20 20 from waeup.kofa.interfaces import REQUESTED 21 21 from waeup.kofa.browser.viewlets import ManageActionButton 22 from kofacustom.s keleton.students.interfaces import (22 from kofacustom.sampleuni.students.interfaces import ( 23 23 ICustomStudentStudyCourse, ICustomStudentStudyLevel) 24 24 from waeup.kofa.students.viewlets import ( … … 28 28 StudyLevelDisplayFormPage) 29 29 30 from kofacustom.nigeria.interfaces import MessageFactory as _30 from waeup.kofa.interfaces import MessageFactory as _ -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/testing.py
r10765 r11687 19 19 """ 20 20 import os.path 21 import kofacustom.s keleton21 import kofacustom.sampleuni 22 22 from zope.app.testing.functional import ZCMLLayer 23 23 24 24 ftesting_zcml = os.path.join( 25 os.path.dirname(kofacustom.s keleton.__file__), 'ftesting.zcml')25 os.path.dirname(kofacustom.sampleuni.__file__), 'ftesting.zcml') 26 26 FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer', 27 27 allow_teardown=True) -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/tests/test_configuration.py
r10765 r11687 25 25 from waeup.kofa.tests.test_configuration import ( 26 26 ConfigurationTest, SessionConfigurationFactoryTest) 27 from kofacustom.s keleton.configuration import (27 from kofacustom.sampleuni.configuration import ( 28 28 CustomSessionConfiguration, CustomSessionConfigurationFactory) 29 from kofacustom.s keleton.interfaces import(29 from kofacustom.sampleuni.interfaces import( 30 30 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 31 from kofacustom.s keleton.testing import FunctionalLayer31 from kofacustom.sampleuni.testing import FunctionalLayer 32 32 33 33 class ConfigurationTest(ConfigurationTest): -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/tests/test_datacenter.py
r10765 r11687 18 18 from waeup.kofa.datacenter import DataCenter 19 19 from waeup.kofa.testing import FunctionalTestCase 20 from kofacustom.s keleton.testing import FunctionalLayer20 from kofacustom.sampleuni.testing import FunctionalLayer 21 21 22 22 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/tests/test_smtp.py
r10765 r11687 33 33 send_mail) 34 34 from waeup.kofa.testing import FunctionalTestCase 35 from kofacustom.s keleton.testing import FunctionalLayer35 from kofacustom.sampleuni.testing import FunctionalLayer 36 36 37 37 # -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/utils/tests.py
r10765 r11687 17 17 ## 18 18 from waeup.kofa.testing import FunctionalTestCase 19 from kofacustom.s keleton.testing import FunctionalLayer19 from kofacustom.sampleuni.testing import FunctionalLayer 20 20 21 21 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/utils/utils.py
r10765 r11687 18 18 """Customize general helper utilities for Kofa. 19 19 """ 20 from kofacustom.nigeria.utils.utils import NigeriaKofaUtils20 from waeup.kofa.utils.utils import KofaUtils 21 21 22 class CustomKofaUtils( NigeriaKofaUtils):22 class CustomKofaUtils(KofaUtils): 23 23 """A collection of methods subject to customization. 24 24 """
Note: See TracChangeset for help on using the changeset viewer.