Changeset 7172 for main


Ignore:
Timestamp:
22 Nov 2011, 17:39:35 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename UserContainer? to UsersContainer? to be in line with ApplicantsContainer?, StudentsContainer?, HostelsCointainer?, PaymentsContainer?. In other words, a userscontainer contains users and it's not the container of a user. This is not really necessary in terms of English grammar but it helps to confuse container types.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
10 edited
3 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/app.py

    r7170 r7172  
    1010from waeup.sirp.interfaces import (
    1111    IUniversity, IWAeUPSIRPPluggable, IObjectUpgradeEvent, )
    12 from waeup.sirp.usercontainer import UserContainer
     12from waeup.sirp.userscontainer import UsersContainer
    1313from waeup.sirp.utils.logger import Logger
    1414from waeup.sirp.utils.helpers import attrs_to_fields
     
    3737        the like.
    3838        """
    39         self['users'] = UserContainer()
     39        self['users'] = UsersContainer()
    4040        self['datacenter'] = DataCenter()
    4141        self['students'] = StudentsContainer()
  • main/waeup.sirp/trunk/src/waeup/sirp/app.txt

    r7170 r7172  
    6565
    6666  >>> myuniversity['users']
    67   <waeup.sirp.usercontainer.UserContainer object at 0x...>
     67  <waeup.sirp.userscontainer.UsersContainer object at 0x...>
    6868
    6969  >>> myuniversity['datacenter']
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.py

    r7169 r7172  
    153153    def getAccount(self, login):
    154154        # ... look up the account object and return it ...
    155         usercontainer = self.getUserContainer()
    156         if usercontainer is None:
     155        userscontainer = self.getUsersContainer()
     156        if userscontainer is None:
    157157            return
    158         return usercontainer.get(login, None)
     158        return userscontainer.get(login, None)
    159159
    160160    def addAccount(self, account):
    161         usercontainer = self.getUserContainer()
    162         if usercontainer is None:
     161        userscontainer = self.getUsersContainer()
     162        if userscontainer is None:
    163163            return
    164164        # XXX: complain if name already exists...
    165         usercontainer.addAccount(account)
     165        userscontainer.addAccount(account)
    166166
    167167    def addUser(self, name, password, title=None, description=None):
    168         usercontainer = self.getUserContainer()
    169         if usercontainer is None:
     168        userscontainer = self.getUsersContainer()
     169        if userscontainer is None:
    170170            return
    171         usercontainer.addUser(name, password, title, description)
    172 
    173     def getUserContainer(self):
     171        userscontainer.addUser(name, password, title, description)
     172
     173    def getUsersContainer(self):
    174174        site = grok.getSite()
    175175        return site['users']
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt

    r7169 r7172  
    4040  >>> root['app']['users'].addAccount(alice)
    4141
    42 See ``users.txt`` for details about the UserContainer we use here.
     42See ``users.txt`` for details about the UsersContainer we use here.
    4343
    4444Users and local roles
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py

    r7137 r7172  
    124124        return 'Session %s' % session_string
    125125
    126 class UserContainerBreadcrumb(Breadcrumb):
     126class UsersContainerBreadcrumb(Breadcrumb):
    127127    """A breadcrumb for user containers.
    128128    """
    129     grok.context(interfaces.IUserContainer)
     129    grok.context(interfaces.IUsersContainer)
    130130    title = u'Portal Users'
    131131    parent_viewname = 'administration'
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.txt

    r6734 r7172  
    120120    [<...breadcrumbs.UniversityBreadcrumb object at 0x...>,
    121121     <...breadcrumbs.AdministrationBreadcrumb object at 0x...>,
    122      <...breadcrumbs.UserContainerBreadcrumb object at 0x...>]
     122     <...breadcrumbs.UsersContainerBreadcrumb object at 0x...>]
    123123
    124124
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/interfaces.py

    r7137 r7172  
    44from zope.interface import Interface, Attribute
    55from waeup.sirp.interfaces import (
    6     IWAeUPObject, IUniversity, IUserContainer, IDataCenter)
     6    IWAeUPObject, IUniversity, IUsersContainer, IDataCenter)
    77from waeup.sirp.university.interfaces import (
    88    IFacultyContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd,
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7169 r7172  
    3232from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable
    3333from waeup.sirp.interfaces import(
    34     IWAeUPObject, IUserContainer, IUserAccount, IDataCenter,
     34    IWAeUPObject, IUsersContainer, IUserAccount, IDataCenter,
    3535    IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor,
    3636    ILocalRolesAssignable, DuplicationError, IConfigurationContainer,
     
    245245#
    246246
    247 class UserContainerPage(WAeUPPage):
     247class UsersContainerPage(WAeUPPage):
    248248    """Overview page for all local users.
    249249    """
    250250    grok.require('waeup.manageUsers')
    251     grok.context(IUserContainer)
     251    grok.context(IUsersContainer)
    252252    grok.name('index')
    253253    title = 'Portal Users'
     
    262262class AddUserFormPage(WAeUPAddFormPage):
    263263    grok.require('waeup.manageUsers')
    264     grok.context(IUserContainer)
     264    grok.context(IUsersContainer)
    265265    grok.name('add')
    266266    grok.template('usereditformpage')
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r7167 r7172  
    1010from waeup.sirp.browser.pages import (
    1111    UniversityPage, FacultyContainerPage, DatacenterPage, FacultyPage,
    12     DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, UserContainerPage)
     12    DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, UsersContainerPage)
    1313from waeup.sirp.browser.interfaces import (
    1414    IFacultyContainer, IFaculty, IDepartment, ICourse, ICertificate,
    15     ICertificateCourse, IBreadcrumbContainer, IUniversity, IUserContainer)
     15    ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer)
    1616from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter,
    1717                                   IWAeUPXMLImporter, IDataCenter)
     
    422422class AddUserActionButton(AddActionButton):
    423423    grok.require('waeup.manageUsers')
    424     grok.context(IUserContainer)
    425     grok.view(UserContainerPage)
     424    grok.context(IUsersContainer)
     425    grok.view(UsersContainerPage)
    426426    text = 'Add user'
    427427
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7149 r7172  
    202202
    203203
    204 class IUserContainer(IWAeUPObject):
     204class IUsersContainer(IWAeUPObject):
    205205    """A container for users (principals).
    206206
  • main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.py

    r7170 r7172  
    1 """User container for the WAeUP portal.
     1"""Users container for the WAeUP portal.
    22"""
    33import grok
    44from zope.event import notify
    55from waeup.sirp.authentication import Account
    6 from waeup.sirp.interfaces import IUserContainer
     6from waeup.sirp.interfaces import IUsersContainer
    77
    8 class UserContainer(grok.Container):
     8class UsersContainer(grok.Container):
    99    """A container for principals.
    1010
    1111    See interfaces.py and users.txt for extensive description.
    1212    """
    13     grok.implements(IUserContainer)
     13    grok.implements(IUsersContainer)
    1414    grok.require('waeup.manageUsers')
    1515
  • main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.txt

    r7170 r7172  
    1414us:
    1515
    16     >>> from waeup.sirp.usercontainer import UserContainer
    17     >>> myusers = UserContainer()
     16    >>> from waeup.sirp.userscontainer import UsersContainer
     17    >>> myusers = UsersContainer()
    1818
    1919We can add users, just by passing a name, a password, and (optionally)
Note: See TracChangeset for help on using the changeset viewer.