Changeset 3922
- Timestamp:
- 7 Feb 2009, 00:18:58 (16 years ago)
- Location:
- waeup/branches/ulif-rewrite/src/waeup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/interfaces.py
r3918 r3922 41 41 """A container for faculties. 42 42 """ 43 def getId(faculty):44 """Get a unique id for a faculty.45 """46 47 43 def addFaculty(faculty): 48 44 """Add an IFactulty object. 45 46 Returns the key, under which the object was stored. 49 47 """ 50 48 -
waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py
r3920 r3922 16 16 next_id = 0L 17 17 18 def getId(self, faculty):19 """We need a unified id for each faculty, which acts as key.20 """21 return str(self.next_id)22 23 18 def addFaculty(self, faculty): 24 19 if not IFaculty.providedBy(faculty): 25 20 raise TypeError('FacultyContainers contain only IFaculty instances') 26 id = s elf.getId(faculty)21 id = str(self.next_id) 27 22 self[id] = faculty 28 23 while self.next_id in self.keys():
Note: See TracChangeset for help on using the changeset viewer.