Ignore:
Timestamp:
8 Jan 2010, 14:36:29 (15 years ago)
Author:
uli
Message:

Switch last University attributes ('hostels' and 'students') to become
container items instead of attributes. Now we can finally get rid of
the specialized traverser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-layout/src/waeup/app.py

    r4747 r4751  
    2525
    2626    def setup(self):
    27         self.students = createObject(u'waeup.StudentContainer')
    28         self.hostels = createObject(u'waeup.HostelContainer')
     27        self['students'] = createObject(u'waeup.StudentContainer')
     28        self['hostels'] = createObject(u'waeup.HostelContainer')
    2929        self['faculties'] = createObject(u'waeup.FacultyContainer')
    3030        self['users'] = UserContainer()
    3131        self['datacenter'] = DataCenter()
    32  
    33     def traverse(self, name):
    34         # If someone requests a subobject 'faculties', we return our
    35         # `faculties` attribute.
    36         if name == 'faculties':
    37             return self['faculties']
    38         elif name == 'hostels':
    39             return self.hostels
    40         elif name == 'students':
    41             return self.students
    42         elif name == 'users':
    43             return self['users']
    44         elif name == 'datacenter':
    45             return self['datacenter']
    46         return None
Note: See TracChangeset for help on using the changeset viewer.