Changeset 7006 for main/waeup.sirp/trunk/src/waeup/sirp/hostels
- Timestamp:
- 6 Nov 2011, 10:11:44 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/hostels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/hostels/catalog.py
r6972 r7006 17 17 grok.context(IBed) 18 18 19 bed_number = index.Field(attribute='bed_number') 19 #bed_id = index.Field(attribute='bed_id') 20 #bed_number = index.Field(attribute='bed_number') 20 21 bed_type = index.Field(attribute='bed_type') 21 22 owner = index.Field(attribute='owner') -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py
r7003 r7006 23 23 from waeup.sirp.utils.helpers import attrs_to_fields 24 24 from waeup.sirp.hostels.interfaces import IHostel, IBed 25 from waeup.sirp.students.interfaces import IBedTicket 25 26 26 27 NOT_OCCUPIED = u'not occupied' … … 181 182 182 183 Bed = attrs_to_fields(Bed) 184 185 @grok.subscribe(IBedTicket, grok.IObjectRemovedEvent) 186 def handle_bedticket_removed(bedticket, event): 187 """If a bed ticket is deleted, we make sure that also the owner attribute 188 of the bed is cleared (set to NOT_OCCUPIED). 189 """ 190 allocated_bed = bedticket.bed 191 allocated_bed.owner = NOT_OCCUPIED 192 notify(grok.ObjectModifiedEvent(allocated_bed))
Note: See TracChangeset for help on using the changeset viewer.