- Timestamp:
- 18 Sep 2012, 21:07:02 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r9197 r9199 93 93 94 94 def title(self): 95 co = self.context. getBedCoordinates()95 co = self.context.coordinates 96 96 return _('Block ${a}, Room ${b}, Bed ${c}', 97 97 mapping = {'a':co[1], 'b':co[2], 'c':co[3]}) … … 354 354 grok.require('waeup.manageHostels') 355 355 form_fields = grok.AutoFields(IBedAllocateStudent).omit( 356 'bed_id' ).omit('bed_number').omit('bed_type')356 'bed_id', 'bed_number', 'bed_type') 357 357 label = _('Allocate student') 358 358 pnav = 5 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r9197 r9199 145 145 grok.provides(IBed) 146 146 147 def getBedCoordinates(self): 147 @property 148 def coordinates(self): 148 149 """Determine the coordinates from the bed_id. 149 150 """ 150 151 return self.bed_id.split('_') 152 153 # The following property attributes are only needed 154 # for the exporter to ease evaluation with Excel. 155 156 @property 157 def hall(self): 158 return self.coordinates[0] 159 160 @property 161 def block(self): 162 return self.coordinates[1] 163 164 @property 165 def room(self): 166 return self.coordinates[2] 167 168 @property 169 def bed(self): 170 return self.coordinates[3] 171 172 @property 173 def special_handling(self): 174 return self.bed_type.split('_')[0] 175 176 @property 177 def sex(self): 178 return self.bed_type.split('_')[1] 179 180 @property 181 def bt(self): 182 return self.bed_type.split('_')[2] 183 151 184 152 185 def bookBed(self, student_id): … … 162 195 """ 163 196 sh, sex, bt = self.bed_type.split('_') 164 hostel_id, block, room_nr, bed = self. getBedCoordinates()197 hostel_id, block, room_nr, bed = self.coordinates 165 198 hostel = self.__parent__ 166 199 beds_for_fresh = getattr(hostel,'beds_for_fresh',[]) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r9197 r9199 199 199 """ 200 200 201 coordinates = Attribute('The coordinates of the bed from bed_id') 202 201 203 def loggerInfo(ob_class, comment): 202 204 """Adds an INFO message to the log file 203 205 """ 204 206 205 def getBedCoordinates():206 """Determine the coordinates from bed_id.207 """208 207 def bookBed(student_id): 209 208 """Book a bed for a student. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9191 r9199 1524 1524 bedticket.bed = bed 1525 1525 hall_title = bed.__parent__.hostel_name 1526 coordinates = bed. getBedCoordinates()[1:]1526 coordinates = bed.coordinates[1:] 1527 1527 block, room_nr, bed_nr = coordinates 1528 1528 bc = _('${a}, Block ${b}, Room ${c}, Bed ${d} (${e})', mapping = { … … 1640 1640 self.context.bed = new_bed 1641 1641 hall_title = new_bed.__parent__.hostel_name 1642 coordinates = new_bed. getBedCoordinates()[1:]1642 coordinates = new_bed.coordinates[1:] 1643 1643 block, room_nr, bed_nr = coordinates 1644 1644 bc = _('${a}, Block ${b}, Room ${c}, Bed ${d} (${e})', mapping = {
Note: See TracChangeset for help on using the changeset viewer.