Changeset 8204


Ignore:
Timestamp:
18 Apr 2012, 06:05:16 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename customized classes - part2.

Attention: All applicants and students on demo portals must be deleted.

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  
    2020from zope.interface import implementedBy
    2121from waeup.kofa.applicants.applicant import Applicant, ApplicantFactory
    22 from waeup.kofa.applicants.interfaces import IApplicantEdit
    2322from waeup.kofa.utils.helpers import attrs_to_fields
    2423from waeup.uniben.applicants.interfaces import(
  • main/waeup.uniben/trunk/src/waeup/uniben/browser/pages.py

    r8187 r8204  
    2121from waeup.kofa.interfaces import IUserAccount
    2222from waeup.uniben.interfaces import (
    23     ISessionConfiguration, ISessionConfigurationAdd)
     23    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
    2424from waeup.kofa.browser.pages import (
    2525    UserEditFormPage, UserManageFormPage, AddUserFormPage)
    2626
    27 class SessionConfigurationAddFormPage(SessionConfigurationAddFormPage):
     27class CustomSessionConfigurationAddFormPage(SessionConfigurationAddFormPage):
    2828    """Add a session configuration object to configuration container.
    2929    """
    30     form_fields = grok.AutoFields(ISessionConfigurationAdd)
     30    form_fields = grok.AutoFields(ICustomSessionConfigurationAdd)
    3131
    32 class SessionConfigurationManageFormPage(SessionConfigurationManageFormPage):
     32class CustomSessionConfigurationManageFormPage(SessionConfigurationManageFormPage):
    3333    """Manage session configuration object.
    3434    """
    35     form_fields = grok.AutoFields(ISessionConfiguration)
     35    form_fields = grok.AutoFields(ICustomSessionConfiguration)
  • main/waeup.uniben/trunk/src/waeup/uniben/browser/pdf.py

    r8093 r8204  
    2323from waeup.kofa.browser.pdf import PDFCreator
    2424
    25 class PDFCreator(PDFCreator):
     25class CustomPDFCreator(PDFCreator):
    2626    """A utility to help with generating PDF docs.
    2727    """
  • main/waeup.uniben/trunk/src/waeup/uniben/configuration.py

    r8020 r8204  
    2525    SessionConfigurationFactory, SessionConfiguration)
    2626from waeup.uniben.interfaces import (
    27     ISessionConfiguration, ISessionConfigurationAdd)
     27    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
    2828
    2929
    30 class SessionConfiguration(SessionConfiguration):
     30class CustomSessionConfiguration(SessionConfiguration):
    3131    """
    3232    Customized session configuration model
    3333    """
    3434
    35     grok.implements(ISessionConfiguration, ISessionConfigurationAdd)
     35    grok.implements(ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
    3636
    37 SessionConfiguration = attrs_to_fields(SessionConfiguration)
     37CustomSessionConfiguration = attrs_to_fields(CustomSessionConfiguration)
    3838
    39 class SessionConfigurationFactory(SessionConfigurationFactory):
     39class CustomSessionConfigurationFactory(SessionConfigurationFactory):
    4040    """A customized factory for session configuration objects.
    4141    """
    4242
    4343    def __call__(self, *args, **kw):
    44         return SessionConfiguration(*args, **kw)
     44        return CustomSessionConfiguration(*args, **kw)
    4545
    4646    def getInterfaces(self):
    47         return implementedBy(SessionConfiguration)
     47        return implementedBy(CustomSessionConfiguration)
  • main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py

    r8101 r8204  
    7474
    7575# It's recommended to replicate all fields from the base package here.
    76 class ISessionConfiguration(ISessionConfiguration):
     76class ICustomSessionConfiguration(ISessionConfiguration):
    7777    """A session configuration object.
    7878    """
     
    147147
    148148
    149 class ISessionConfigurationAdd(ISessionConfiguration):
     149class ICustomSessionConfigurationAdd(ISessionConfiguration):
    150150    """A session configuration object in add mode.
    151151    """
     
    159159        )
    160160
    161 ISessionConfigurationAdd['academic_session'].order =  ISessionConfiguration[
     161ICustomSessionConfigurationAdd[
     162    'academic_session'].order =  ICustomSessionConfiguration[
    162163    'academic_session'].order
  • main/waeup.uniben/trunk/src/waeup/uniben/overrides.zcml

    r8191 r8204  
    99           zope.publisher.interfaces.browser.IBrowserRequest"
    1010      provides="zope.formlib.interfaces.ISimpleInputWidget"
    11       factory="waeup.uniben.widgets.phonewidget.SmallPhoneWidget"
     11      factory="waeup.uniben.widgets.phonewidget.CustomPhoneWidget"
    1212      permission="zope.Public"
    1313      />
  • main/waeup.uniben/trunk/src/waeup/uniben/students/batching.py

    r8020 r8204  
    2525"""
    2626from waeup.uniben.students.interfaces import (
    27     IStudent,
     27    ICustomStudent,
    2828    )
    2929from waeup.kofa.students.batching import StudentProcessor
    3030
    31 class StudentProcessor(StudentProcessor):
     31class CustomStudentProcessor(StudentProcessor):
    3232    """A batch processor for IStudent objects.
    3333    """
    34     iface = IStudent
     34    iface = ICustomStudent
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r8187 r8204  
    2828from waeup.kofa.students.viewlets import RequestCallbackActionButton
    2929from waeup.uniben.students.interfaces import (
    30     IStudentBase, IStudent, IStudentPersonal,
    31     IUGStudentClearance,IPGStudentClearance,
     30    ICustomStudentBase, ICustomStudent, ICustomStudentPersonal,
     31    ICustomUGStudentClearance,ICustomPGStudentClearance,
    3232    )
    3333from waeup.uniben.interfaces import MessageFactory as _
    3434
    35 class RequestCallbackActionButton(RequestCallbackActionButton):
     35class CustomRequestCallbackActionButton(RequestCallbackActionButton):
    3636    """ Do not display the base package callback button in custom pages.
    3737    """
     
    4040        return ''
    4141
    42 class OnlinePaymentCallbackPage(OnlinePaymentCallbackPage):
     42class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage):
    4343    """ Neutralize callback simulation view
    4444    """
     
    4646        return
    4747
    48 class StudentBaseManageFormPage(StudentBaseManageFormPage):
     48class CustomStudentBaseManageFormPage(StudentBaseManageFormPage):
    4949    """ View to manage student base data
    5050    """
    51     form_fields = grok.AutoFields(IStudentBase).omit('student_id')
     51    form_fields = grok.AutoFields(ICustomStudentBase).omit('student_id')
    5252
    53 class StudentBaseEditFormPage(StudentBaseEditFormPage):
     53class CustomStudentBaseEditFormPage(StudentBaseEditFormPage):
    5454    """ View to edit student base data
    5555    """
    56     form_fields = grok.AutoFields(IStudentBase).select(
     56    form_fields = grok.AutoFields(ICustomStudentBase).select(
    5757        'email', 'phone')
    5858
    5959
    60 class StudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):
     60class CustomStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):
    6161    """ Page to display student personal data
    6262    """
    63     grok.context(IStudent)
    64     form_fields = grok.AutoFields(IStudentPersonal)
     63    grok.context(ICustomStudent)
     64    form_fields = grok.AutoFields(ICustomStudentPersonal)
    6565    form_fields['perm_address'].custom_widget = BytesDisplayWidget
    6666
    6767
    68 class StudentPersonalEditFormPage(StudentPersonalEditFormPage):
     68class CustomStudentPersonalEditFormPage(StudentPersonalEditFormPage):
    6969    """ Page to edit personal data
    7070    """
    71     form_fields = grok.AutoFields(IStudentPersonal)
     71    form_fields = grok.AutoFields(ICustomStudentPersonal)
    7272
    7373
    74 class StudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):
     74class CustomStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):
    7575    """ Page to display student clearance data
    7676    """
    77     grok.context(IStudent)
     77    grok.context(ICustomStudent)
    7878
    7979    @property
     
    8181        cm = getattr(self.context,'current_mode', None)
    8282        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')
    8485        else:
    85             form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
     86            form_fields = grok.AutoFields(
     87                ICustomUGStudentClearance).omit('clearance_locked')
    8688        return form_fields
    8789
    88 class ExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
     90class CustomExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
    8991    """Deliver a PDF slip of the context.
    9092    """
    91     grok.context(IStudent)
     93    grok.context(ICustomStudent)
    9294
    9395    @property
     
    9597        cm = getattr(self.context,'current_mode', None)
    9698        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')
    98101        else:
    99             form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
     102            form_fields = grok.AutoFields(
     103                ICustomUGStudentClearance).omit('clearance_locked')
    100104        return form_fields
    101105
    102 class StudentClearanceManageFormPage(StudentClearanceManageFormPage):
     106class CustomStudentClearanceManageFormPage(StudentClearanceManageFormPage):
    103107    """ Page to edit student clearance data
    104108    """
    105     grok.context(IStudent)
     109    grok.context(ICustomStudent)
    106110
    107111    @property
     
    109113        cm = getattr(self.context,'current_mode', None)
    110114        if cm is not None and cm.startswith('pg'):
    111             form_fields = grok.AutoFields(IPGStudentClearance)
     115            form_fields = grok.AutoFields(ICustomPGStudentClearance)
    112116        else:
    113             form_fields = grok.AutoFields(IUGStudentClearance)
     117            form_fields = grok.AutoFields(ICustomUGStudentClearance)
    114118        return form_fields
    115119
    116 class StudentClearanceEditFormPage(StudentClearanceEditFormPage):
     120class CustomStudentClearanceEditFormPage(StudentClearanceEditFormPage):
    117121    """ View to edit student clearance data by student
    118122    """
    119     grok.context(IStudent)
     123    grok.context(ICustomStudent)
    120124
    121125    @property
     
    123127        cm = getattr(self.context,'current_mode', None)
    124128        if cm is not None and cm.startswith('pg'):
    125             form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
     129            form_fields = grok.AutoFields(ICustomPGStudentClearance).omit('clearance_locked')
    126130        else:
    127             form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
     131            form_fields = grok.AutoFields(ICustomUGStudentClearance).omit('clearance_locked')
    128132        return form_fields
    129133
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r8184 r8204  
    3232from waeup.uniben.interfaces import MessageFactory as _
    3333
    34 class IStudentBase(IStudentBase):
     34class ICustomStudentBase(IStudentBase):
    3535    """Representation of student base data.
    3636
     
    4444        )
    4545
    46 class IStudentPersonal(IStudentPersonal):
     46class ICustomStudentPersonal(IStudentPersonal):
    4747    """Student personal data.
    4848
     
    5858        )
    5959
    60 class IUGStudentClearance(IUGStudentClearance):
     60class ICustomUGStudentClearance(IUGStudentClearance):
    6161    """Representation of ug student clearance data.
    6262
     
    213213
    214214
    215 class IPGStudentClearance(IUGStudentClearance):
     215class ICustomPGStudentClearance(IUGStudentClearance):
    216216    """Representation of pg student clearance data.
    217217
     
    334334
    335335
    336 class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,IStudentPersonal):
     336class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
     337    ICustomPGStudentClearance,ICustomStudentPersonal):
    337338    """Representation of a student.
    338339
  • main/waeup.uniben/trunk/src/waeup/uniben/students/student.py

    r8020 r8204  
    2323from waeup.kofa.utils.helpers import attrs_to_fields
    2424from waeup.kofa.students.student import Student, StudentFactory
    25 from waeup.uniben.students.interfaces import IStudent, IStudentNavigation
     25from waeup.uniben.students.interfaces import ICustomStudent, IStudentNavigation
    2626
    2727
    28 class Student(Student):
     28class CustomStudent(Student):
    2929    """This is a student container for the various objects
    3030    owned by students.
    3131    """
    32     grok.implements(IStudent, IStudentNavigation)
    33     grok.provides(IStudent)
     32    grok.implements(ICustomStudent, IStudentNavigation)
     33    grok.provides(ICustomStudent)
    3434
    3535
     
    3838# ourselves and as a bonus we get free validation when an attribute is
    3939# set.
    40 Student = attrs_to_fields(Student)
     40CustomStudent = attrs_to_fields(CustomStudent)
    4141
    42 class StudentFactory(StudentFactory):
     42class CustomStudentFactory(StudentFactory):
    4343    """A factory for students.
    4444    """
    4545
    4646    def __call__(self, *args, **kw):
    47         return Student()
     47        return CustomStudent()
    4848
    4949    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  
    2424from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2525from waeup.kofa.testing import FunctionalTestCase
    26 from waeup.kofa.students.batching import StudentProcessor as StudentProcessorBase
    27 from waeup.uniben.students.batching import StudentProcessor
     26from waeup.kofa.students.batching import StudentProcessor
     27from waeup.uniben.students.batching import CustomStudentProcessor
    2828from waeup.uniben.testing import FunctionalLayer
    2929
     
    5858        setSite(app)
    5959
    60         self.processor_base = StudentProcessorBase()
    61         self.processor = StudentProcessor()
     60        self.processor_base = StudentProcessor()
     61        self.processor = CustomStudentProcessor()
    6262        self.workdir = tempfile.mkdtemp()
    6363        self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv')
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r8136 r8204  
    4242        return 0.0
    4343
    44 class StudentsUtils(StudentsUtils):
     44class CustomStudentsUtils(StudentsUtils):
    4545    """A collection of customized methods.
    4646
  • main/waeup.uniben/trunk/src/waeup/uniben/tests/test_configuration.py

    r8020 r8204  
    2626    ConfigurationTest, SessionConfigurationFactoryTest)
    2727from waeup.uniben.configuration import (
    28     SessionConfiguration, SessionConfigurationFactory)
     28    CustomSessionConfiguration, CustomSessionConfigurationFactory)
    2929from waeup.uniben.interfaces import(
    30     ISessionConfiguration, ISessionConfigurationAdd)
     30    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
    3131from waeup.uniben.testing import FunctionalLayer
    3232
     
    3838        super(ConfigurationTest, self).setUp()
    3939        self.confcontainer = ConfigurationContainer()
    40         self.sessionconf = SessionConfiguration()
     40        self.sessionconf = CustomSessionConfiguration()
    4141        return
    4242
     
    4848        #verify.verifyClass(IConfigurationContainer, ConfigurationContainer)
    4949        #verify.verifyObject(IConfigurationContainer, self.confcontainer)
    50         verify.verifyClass(ISessionConfiguration, SessionConfiguration)
    51         verify.verifyObject(ISessionConfiguration, self.sessionconf)
    52         verify.verifyClass(ISessionConfigurationAdd, SessionConfiguration)
    53         verify.verifyObject(ISessionConfigurationAdd, self.sessionconf)
     50        verify.verifyClass(ICustomSessionConfiguration, CustomSessionConfiguration)
     51        verify.verifyObject(ICustomSessionConfiguration, self.sessionconf)
     52        verify.verifyClass(ICustomSessionConfigurationAdd, CustomSessionConfiguration)
     53        verify.verifyObject(ICustomSessionConfigurationAdd, self.sessionconf)
    5454
    5555class SessionConfigurationFactoryTest(SessionConfigurationFactoryTest):
     
    5959    def setUp(self):
    6060        super(SessionConfigurationFactoryTest, self).setUp()
    61         self.factory = SessionConfigurationFactory()
     61        self.factory = CustomSessionConfigurationFactory()
    6262
    6363    #def tearDown(self):
     
    6565
    6666    def test_interfaces(self):
    67         verify.verifyClass(IFactory, SessionConfigurationFactory)
     67        verify.verifyClass(IFactory, CustomSessionConfigurationFactory)
    6868        verify.verifyObject(IFactory, self.factory)
    6969
    7070    def test_factory(self):
    7171        obj = self.factory()
    72         assert isinstance(obj, SessionConfiguration)
     72        assert isinstance(obj, CustomSessionConfiguration)
    7373
    7474    def test_getInterfaces(self):
    7575        implemented_by = self.factory.getInterfaces()
    76         assert implemented_by.isOrExtends(ISessionConfiguration)
     76        assert implemented_by.isOrExtends(ICustomSessionConfiguration)
  • main/waeup.uniben/trunk/src/waeup/uniben/widgets/phonewidget.py

    r8190 r8204  
    2222from waeup.kofa.widgets.phonewidget import PhoneWidget
    2323
    24 class SmallPhoneWidget(PhoneWidget):
     24class CustomPhoneWidget(PhoneWidget):
    2525    """A phone widget without area prefix.
    2626    """
Note: See TracChangeset for help on using the changeset viewer.