Changeset 4230 for waeup/branches/ulif-rewrite
- Timestamp:
- 9 Jun 2009, 08:54:12 (16 years ago)
- Location:
- waeup/branches/ulif-rewrite/src/waeup/university
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/faculty.py
r4229 r4230 15 15 title=u'Unnamed Faculty', 16 16 title_prefix=u'faculty', 17 code= None, **kw):17 code=u'NA', **kw): 18 18 super(Faculty, self).__init__(**kw) 19 19 self.title = title -
waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py
r4222 r4230 19 19 grok.require('waeup.manageUniversity') 20 20 21 # A simple counter for ids.22 next_id = 0L23 24 21 def addFaculty(self, faculty): 25 22 if not IFaculty.providedBy(faculty): 26 23 raise TypeError('FacultyContainers contain only IFaculty instances') 27 id = str(self.next_id) 28 self[id] = faculty 29 while str(self.next_id) in self.keys(): 30 # Look for next unused int... 31 self.next_id += 1 32 return id 24 self[faculty.code] = faculty 25 return 33 26 34 27 def clear(self):
Note: See TracChangeset for help on using the changeset viewer.