Changeset 8204 for main/waeup.uniben/trunk
- Timestamp:
- 18 Apr 2012, 06:05:16 (13 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py
r8196 r8204 20 20 from zope.interface import implementedBy 21 21 from waeup.kofa.applicants.applicant import Applicant, ApplicantFactory 22 from waeup.kofa.applicants.interfaces import IApplicantEdit23 22 from waeup.kofa.utils.helpers import attrs_to_fields 24 23 from waeup.uniben.applicants.interfaces import( -
main/waeup.uniben/trunk/src/waeup/uniben/browser/pages.py
r8187 r8204 21 21 from waeup.kofa.interfaces import IUserAccount 22 22 from waeup.uniben.interfaces import ( 23 I SessionConfiguration, ISessionConfigurationAdd)23 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 24 24 from waeup.kofa.browser.pages import ( 25 25 UserEditFormPage, UserManageFormPage, AddUserFormPage) 26 26 27 class SessionConfigurationAddFormPage(SessionConfigurationAddFormPage):27 class CustomSessionConfigurationAddFormPage(SessionConfigurationAddFormPage): 28 28 """Add a session configuration object to configuration container. 29 29 """ 30 form_fields = grok.AutoFields(I SessionConfigurationAdd)30 form_fields = grok.AutoFields(ICustomSessionConfigurationAdd) 31 31 32 class SessionConfigurationManageFormPage(SessionConfigurationManageFormPage):32 class CustomSessionConfigurationManageFormPage(SessionConfigurationManageFormPage): 33 33 """Manage session configuration object. 34 34 """ 35 form_fields = grok.AutoFields(I SessionConfiguration)35 form_fields = grok.AutoFields(ICustomSessionConfiguration) -
main/waeup.uniben/trunk/src/waeup/uniben/browser/pdf.py
r8093 r8204 23 23 from waeup.kofa.browser.pdf import PDFCreator 24 24 25 class PDFCreator(PDFCreator):25 class CustomPDFCreator(PDFCreator): 26 26 """A utility to help with generating PDF docs. 27 27 """ -
main/waeup.uniben/trunk/src/waeup/uniben/configuration.py
r8020 r8204 25 25 SessionConfigurationFactory, SessionConfiguration) 26 26 from waeup.uniben.interfaces import ( 27 I SessionConfiguration, ISessionConfigurationAdd)27 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 28 28 29 29 30 class SessionConfiguration(SessionConfiguration):30 class CustomSessionConfiguration(SessionConfiguration): 31 31 """ 32 32 Customized session configuration model 33 33 """ 34 34 35 grok.implements(I SessionConfiguration, ISessionConfigurationAdd)35 grok.implements(ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 36 36 37 SessionConfiguration = attrs_to_fields(SessionConfiguration)37 CustomSessionConfiguration = attrs_to_fields(CustomSessionConfiguration) 38 38 39 class SessionConfigurationFactory(SessionConfigurationFactory):39 class CustomSessionConfigurationFactory(SessionConfigurationFactory): 40 40 """A customized factory for session configuration objects. 41 41 """ 42 42 43 43 def __call__(self, *args, **kw): 44 return SessionConfiguration(*args, **kw)44 return CustomSessionConfiguration(*args, **kw) 45 45 46 46 def getInterfaces(self): 47 return implementedBy( SessionConfiguration)47 return implementedBy(CustomSessionConfiguration) -
main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py
r8101 r8204 74 74 75 75 # It's recommended to replicate all fields from the base package here. 76 class I SessionConfiguration(ISessionConfiguration):76 class ICustomSessionConfiguration(ISessionConfiguration): 77 77 """A session configuration object. 78 78 """ … … 147 147 148 148 149 class I SessionConfigurationAdd(ISessionConfiguration):149 class ICustomSessionConfigurationAdd(ISessionConfiguration): 150 150 """A session configuration object in add mode. 151 151 """ … … 159 159 ) 160 160 161 ISessionConfigurationAdd['academic_session'].order = ISessionConfiguration[ 161 ICustomSessionConfigurationAdd[ 162 'academic_session'].order = ICustomSessionConfiguration[ 162 163 'academic_session'].order -
main/waeup.uniben/trunk/src/waeup/uniben/overrides.zcml
r8191 r8204 9 9 zope.publisher.interfaces.browser.IBrowserRequest" 10 10 provides="zope.formlib.interfaces.ISimpleInputWidget" 11 factory="waeup.uniben.widgets.phonewidget. SmallPhoneWidget"11 factory="waeup.uniben.widgets.phonewidget.CustomPhoneWidget" 12 12 permission="zope.Public" 13 13 /> -
main/waeup.uniben/trunk/src/waeup/uniben/students/batching.py
r8020 r8204 25 25 """ 26 26 from waeup.uniben.students.interfaces import ( 27 I Student,27 ICustomStudent, 28 28 ) 29 29 from waeup.kofa.students.batching import StudentProcessor 30 30 31 class StudentProcessor(StudentProcessor):31 class CustomStudentProcessor(StudentProcessor): 32 32 """A batch processor for IStudent objects. 33 33 """ 34 iface = I Student34 iface = ICustomStudent -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r8187 r8204 28 28 from waeup.kofa.students.viewlets import RequestCallbackActionButton 29 29 from waeup.uniben.students.interfaces import ( 30 I StudentBase, IStudent, IStudentPersonal,31 I UGStudentClearance,IPGStudentClearance,30 ICustomStudentBase, ICustomStudent, ICustomStudentPersonal, 31 ICustomUGStudentClearance,ICustomPGStudentClearance, 32 32 ) 33 33 from waeup.uniben.interfaces import MessageFactory as _ 34 34 35 class RequestCallbackActionButton(RequestCallbackActionButton):35 class CustomRequestCallbackActionButton(RequestCallbackActionButton): 36 36 """ Do not display the base package callback button in custom pages. 37 37 """ … … 40 40 return '' 41 41 42 class OnlinePaymentCallbackPage(OnlinePaymentCallbackPage):42 class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage): 43 43 """ Neutralize callback simulation view 44 44 """ … … 46 46 return 47 47 48 class StudentBaseManageFormPage(StudentBaseManageFormPage):48 class CustomStudentBaseManageFormPage(StudentBaseManageFormPage): 49 49 """ View to manage student base data 50 50 """ 51 form_fields = grok.AutoFields(I StudentBase).omit('student_id')51 form_fields = grok.AutoFields(ICustomStudentBase).omit('student_id') 52 52 53 class StudentBaseEditFormPage(StudentBaseEditFormPage):53 class CustomStudentBaseEditFormPage(StudentBaseEditFormPage): 54 54 """ View to edit student base data 55 55 """ 56 form_fields = grok.AutoFields(I StudentBase).select(56 form_fields = grok.AutoFields(ICustomStudentBase).select( 57 57 'email', 'phone') 58 58 59 59 60 class StudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):60 class CustomStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage): 61 61 """ Page to display student personal data 62 62 """ 63 grok.context(I Student)64 form_fields = grok.AutoFields(I StudentPersonal)63 grok.context(ICustomStudent) 64 form_fields = grok.AutoFields(ICustomStudentPersonal) 65 65 form_fields['perm_address'].custom_widget = BytesDisplayWidget 66 66 67 67 68 class StudentPersonalEditFormPage(StudentPersonalEditFormPage):68 class CustomStudentPersonalEditFormPage(StudentPersonalEditFormPage): 69 69 """ Page to edit personal data 70 70 """ 71 form_fields = grok.AutoFields(I StudentPersonal)71 form_fields = grok.AutoFields(ICustomStudentPersonal) 72 72 73 73 74 class StudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):74 class CustomStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage): 75 75 """ Page to display student clearance data 76 76 """ 77 grok.context(I Student)77 grok.context(ICustomStudent) 78 78 79 79 @property … … 81 81 cm = getattr(self.context,'current_mode', None) 82 82 if cm is not None and cm.startswith('pg'): 83 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 83 form_fields = grok.AutoFields( 84 ICustomPGStudentClearance).omit('clearance_locked') 84 85 else: 85 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 86 form_fields = grok.AutoFields( 87 ICustomUGStudentClearance).omit('clearance_locked') 86 88 return form_fields 87 89 88 class ExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):90 class CustomExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage): 89 91 """Deliver a PDF slip of the context. 90 92 """ 91 grok.context(I Student)93 grok.context(ICustomStudent) 92 94 93 95 @property … … 95 97 cm = getattr(self.context,'current_mode', None) 96 98 if cm is not None and cm.startswith('pg'): 97 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 99 form_fields = grok.AutoFields( 100 ICustomPGStudentClearance).omit('clearance_locked') 98 101 else: 99 form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked') 102 form_fields = grok.AutoFields( 103 ICustomUGStudentClearance).omit('clearance_locked') 100 104 return form_fields 101 105 102 class StudentClearanceManageFormPage(StudentClearanceManageFormPage):106 class CustomStudentClearanceManageFormPage(StudentClearanceManageFormPage): 103 107 """ Page to edit student clearance data 104 108 """ 105 grok.context(I Student)109 grok.context(ICustomStudent) 106 110 107 111 @property … … 109 113 cm = getattr(self.context,'current_mode', None) 110 114 if cm is not None and cm.startswith('pg'): 111 form_fields = grok.AutoFields(I PGStudentClearance)115 form_fields = grok.AutoFields(ICustomPGStudentClearance) 112 116 else: 113 form_fields = grok.AutoFields(I UGStudentClearance)117 form_fields = grok.AutoFields(ICustomUGStudentClearance) 114 118 return form_fields 115 119 116 class StudentClearanceEditFormPage(StudentClearanceEditFormPage):120 class CustomStudentClearanceEditFormPage(StudentClearanceEditFormPage): 117 121 """ View to edit student clearance data by student 118 122 """ 119 grok.context(I Student)123 grok.context(ICustomStudent) 120 124 121 125 @property … … 123 127 cm = getattr(self.context,'current_mode', None) 124 128 if cm is not None and cm.startswith('pg'): 125 form_fields = grok.AutoFields(I PGStudentClearance).omit('clearance_locked')129 form_fields = grok.AutoFields(ICustomPGStudentClearance).omit('clearance_locked') 126 130 else: 127 form_fields = grok.AutoFields(I UGStudentClearance).omit('clearance_locked')131 form_fields = grok.AutoFields(ICustomUGStudentClearance).omit('clearance_locked') 128 132 return form_fields 129 133 -
main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py
r8184 r8204 32 32 from waeup.uniben.interfaces import MessageFactory as _ 33 33 34 class I StudentBase(IStudentBase):34 class ICustomStudentBase(IStudentBase): 35 35 """Representation of student base data. 36 36 … … 44 44 ) 45 45 46 class I StudentPersonal(IStudentPersonal):46 class ICustomStudentPersonal(IStudentPersonal): 47 47 """Student personal data. 48 48 … … 58 58 ) 59 59 60 class I UGStudentClearance(IUGStudentClearance):60 class ICustomUGStudentClearance(IUGStudentClearance): 61 61 """Representation of ug student clearance data. 62 62 … … 213 213 214 214 215 class I PGStudentClearance(IUGStudentClearance):215 class ICustomPGStudentClearance(IUGStudentClearance): 216 216 """Representation of pg student clearance data. 217 217 … … 334 334 335 335 336 class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,IStudentPersonal): 336 class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, 337 ICustomPGStudentClearance,ICustomStudentPersonal): 337 338 """Representation of a student. 338 339 -
main/waeup.uniben/trunk/src/waeup/uniben/students/student.py
r8020 r8204 23 23 from waeup.kofa.utils.helpers import attrs_to_fields 24 24 from waeup.kofa.students.student import Student, StudentFactory 25 from waeup.uniben.students.interfaces import I Student, IStudentNavigation25 from waeup.uniben.students.interfaces import ICustomStudent, IStudentNavigation 26 26 27 27 28 class Student(Student):28 class CustomStudent(Student): 29 29 """This is a student container for the various objects 30 30 owned by students. 31 31 """ 32 grok.implements(I Student, IStudentNavigation)33 grok.provides(I Student)32 grok.implements(ICustomStudent, IStudentNavigation) 33 grok.provides(ICustomStudent) 34 34 35 35 … … 38 38 # ourselves and as a bonus we get free validation when an attribute is 39 39 # set. 40 Student = attrs_to_fields(Student)40 CustomStudent = attrs_to_fields(CustomStudent) 41 41 42 class StudentFactory(StudentFactory):42 class CustomStudentFactory(StudentFactory): 43 43 """A factory for students. 44 44 """ 45 45 46 46 def __call__(self, *args, **kw): 47 return Student()47 return CustomStudent() 48 48 49 49 def getInterfaces(self): 50 return implementedBy( Student)50 return implementedBy(CustomStudent) -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r8020 r8204 24 24 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 25 25 from waeup.kofa.testing import FunctionalTestCase 26 from waeup.kofa.students.batching import StudentProcessor as StudentProcessorBase27 from waeup.uniben.students.batching import StudentProcessor26 from waeup.kofa.students.batching import StudentProcessor 27 from waeup.uniben.students.batching import CustomStudentProcessor 28 28 from waeup.uniben.testing import FunctionalLayer 29 29 … … 58 58 setSite(app) 59 59 60 self.processor_base = StudentProcessor Base()61 self.processor = StudentProcessor()60 self.processor_base = StudentProcessor() 61 self.processor = CustomStudentProcessor() 62 62 self.workdir = tempfile.mkdtemp() 63 63 self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv') -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r8136 r8204 42 42 return 0.0 43 43 44 class StudentsUtils(StudentsUtils):44 class CustomStudentsUtils(StudentsUtils): 45 45 """A collection of customized methods. 46 46 -
main/waeup.uniben/trunk/src/waeup/uniben/tests/test_configuration.py
r8020 r8204 26 26 ConfigurationTest, SessionConfigurationFactoryTest) 27 27 from waeup.uniben.configuration import ( 28 SessionConfiguration,SessionConfigurationFactory)28 CustomSessionConfiguration, CustomSessionConfigurationFactory) 29 29 from waeup.uniben.interfaces import( 30 I SessionConfiguration, ISessionConfigurationAdd)30 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 31 31 from waeup.uniben.testing import FunctionalLayer 32 32 … … 38 38 super(ConfigurationTest, self).setUp() 39 39 self.confcontainer = ConfigurationContainer() 40 self.sessionconf = SessionConfiguration()40 self.sessionconf = CustomSessionConfiguration() 41 41 return 42 42 … … 48 48 #verify.verifyClass(IConfigurationContainer, ConfigurationContainer) 49 49 #verify.verifyObject(IConfigurationContainer, self.confcontainer) 50 verify.verifyClass(I SessionConfiguration,SessionConfiguration)51 verify.verifyObject(I SessionConfiguration, self.sessionconf)52 verify.verifyClass(I SessionConfigurationAdd,SessionConfiguration)53 verify.verifyObject(I SessionConfigurationAdd, self.sessionconf)50 verify.verifyClass(ICustomSessionConfiguration, CustomSessionConfiguration) 51 verify.verifyObject(ICustomSessionConfiguration, self.sessionconf) 52 verify.verifyClass(ICustomSessionConfigurationAdd, CustomSessionConfiguration) 53 verify.verifyObject(ICustomSessionConfigurationAdd, self.sessionconf) 54 54 55 55 class SessionConfigurationFactoryTest(SessionConfigurationFactoryTest): … … 59 59 def setUp(self): 60 60 super(SessionConfigurationFactoryTest, self).setUp() 61 self.factory = SessionConfigurationFactory()61 self.factory = CustomSessionConfigurationFactory() 62 62 63 63 #def tearDown(self): … … 65 65 66 66 def test_interfaces(self): 67 verify.verifyClass(IFactory, SessionConfigurationFactory)67 verify.verifyClass(IFactory, CustomSessionConfigurationFactory) 68 68 verify.verifyObject(IFactory, self.factory) 69 69 70 70 def test_factory(self): 71 71 obj = self.factory() 72 assert isinstance(obj, SessionConfiguration)72 assert isinstance(obj, CustomSessionConfiguration) 73 73 74 74 def test_getInterfaces(self): 75 75 implemented_by = self.factory.getInterfaces() 76 assert implemented_by.isOrExtends(I SessionConfiguration)76 assert implemented_by.isOrExtends(ICustomSessionConfiguration) -
main/waeup.uniben/trunk/src/waeup/uniben/widgets/phonewidget.py
r8190 r8204 22 22 from waeup.kofa.widgets.phonewidget import PhoneWidget 23 23 24 class SmallPhoneWidget(PhoneWidget):24 class CustomPhoneWidget(PhoneWidget): 25 25 """A phone widget without area prefix. 26 26 """
Note: See TracChangeset for help on using the changeset viewer.