Changeset 9003


Ignore:
Timestamp:
15 Jul 2012, 01:31:03 (12 years ago)
Author:
uli
Message:

Fix import of student/applicant interfaces in w.k.browser.interfaces.
w.k.browser interfaces should not rely on interfaces defined in other
submodules except they are core part.

Also move purely UI-related interface from w.k.interfaces to w.k.browser.

Location:
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/interfaces.py

    r8257 r9003  
    2121from zope.interface import Interface, Attribute
    2222from waeup.kofa.interfaces import (
    23     IKofaObject, IUniversity, IUsersContainer, IDataCenter)
     23    IKofaObject, IUniversity, IUsersContainer, IDataCenter, validate_email)
     24from waeup.kofa.interfaces import MessageFactory as _
    2425from waeup.kofa.university.interfaces import (
    2526    IFacultiesContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd,
     
    196197        If no `title` is given, nothing will be rendered.
    197198        """
     199
     200class IChangePassword(IKofaObject):
     201    """Interface needed for change pasword page.
     202
     203    """
     204    identifier = schema.TextLine(
     205        title = _(u'Unique Identifier'),
     206        description = _(
     207            u'User Name, Student or Applicant Id, Matriculation or '
     208            u'Registration Number'),
     209        required = True,
     210        readonly = False,
     211        )
     212
     213    email = schema.ASCIILine(
     214        title = _(u'Email Address'),
     215        required = True,
     216        constraint=validate_email,
     217        )
     218
     219class IStudentNavigationBase(IKofaObject):
     220    """Objects that provide student navigation (whatever it is) should
     221       implement this interface.
     222    """
     223    student = Attribute('''Some student object that has a '''
     224                        ''' `display_fullname` attribute.''')
     225
     226class IApplicantBase(IKofaObject):
     227    """Some Applicant.
     228    """
     229    display_fullname = Attribute('''Fullname.''')
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/layout.py

    r8736 r9003  
    3636from waeup.kofa.interfaces import MessageFactory as _
    3737from waeup.kofa.utils.helpers import to_timezone
    38 from waeup.kofa.browser.interfaces import ITheme
     38from waeup.kofa.browser.interfaces import (
     39    ITheme, IStudentNavigationBase, IApplicantBase)
    3940from waeup.kofa.browser.theming import get_all_themes, KofaThemeBase
    40 from waeup.kofa.students.interfaces import IStudentNavigation
    41 from waeup.kofa.applicants.interfaces import IApplicant
    4241from waeup.kofa.authentication import get_principal_role_manager
    4342
     
    281280        """Return the student name.
    282281        """
    283         if IStudentNavigation.providedBy(self.context):
     282        if IStudentNavigationBase.providedBy(self.context):
    284283            return self.context.student.display_fullname
    285284        return
     
    288287        """Return the applicant name.
    289288        """
    290         if IApplicant.providedBy(self.context):
     289        if IApplicantBase.providedBy(self.context):
     290            # XXX: shouldn't that be `display_fullname???`
    291291            return self.context.fullname
    292292        return
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/pages.py

    r8783 r9003  
    4646    IDepartment, IDepartmentAdd, ICourse, ICourseAdd, ICertificate,
    4747    ICertificateAdd, ICertificateCourse, ICertificateCourseAdd,
    48     ICaptchaManager)
     48    ICaptchaManager, IChangePassword)
    4949from waeup.kofa.browser.layout import jsaction, action, UtilityView
    5050from waeup.kofa.browser.resources import warning, datepicker, tabs, datatable
     
    5555    ILocalRolesAssignable, DuplicationError, IConfigurationContainer,
    5656    ISessionConfiguration, ISessionConfigurationAdd,
    57     IPasswordValidator, IContactForm, IKofaUtils, ICSVExporter,
    58     IChangePassword)
     57    IPasswordValidator, IContactForm, IKofaUtils, ICSVExporter,)
    5958from waeup.kofa.permissions import (
    6059    get_users_with_local_roles, get_all_roles, get_all_users)
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/interfaces.py

    r8759 r9003  
    10901090        )
    10911091
    1092 class IChangePassword(IKofaObject):
    1093     """Interface needed for change pasword page.
    1094 
    1095     """
    1096     identifier = schema.TextLine(
    1097         title = _(u'Unique Identifier'),
    1098         description = _(
    1099             u'User Name, Student or Applicant Id, Matriculation or '
    1100             u'Registration Number'),
    1101         required = True,
    1102         readonly = False,
    1103         )
    1104 
    1105     email = schema.ASCIILine(
    1106         title = _(u'Email Address'),
    1107         required = True,
    1108         constraint=validate_email,
    1109         )
Note: See TracChangeset for help on using the changeset viewer.