Changeset 8186 for main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Timestamp:
- 17 Apr 2012, 00:31:10 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r8183 r8186 29 29 from waeup.kofa.interfaces import IKofaUtils 30 30 from waeup.kofa.interfaces import MessageFactory as _ 31 from waeup.kofa.utils.helpers import now 31 32 32 33 class Hostel(grok.Container): … … 164 165 165 166 # Comment of Martijn: 166 # If you have a non-Persistent subobject (like a list) and you change it, 167 # you need to manually flag the persistence machinery on the object that 168 # its subobject changed, with _p_changed. This is only necessary if some 169 # of the objects are not sublclasses of Persistent. For common built-in 170 # collections in Python such as list and dictionary there are replacements 171 # (PersistentList, PersistentMapping), and more advanced building blocks 167 # If you have a non-Persistent subobject (like a list) and 168 # you change it, you need to manually flag the persistence 169 # machinery on the object that its subobject changed, with 170 # _p_changed. This is only necessary if some of the 171 # objects are not sublclasses of Persistent. For common 172 # built-in collections in Python such as list and 173 # dictionary there are replacements (PersistentList, 174 # PersistentMapping), and more advanced building blocks 172 175 # for indexes (BTrees), that don't have this issue. 173 176 #hostel._p_changed = True … … 207 210 bedticket.bed = None 208 211 tz = getUtility(IKofaUtils).tzinfo 209 timestamp = datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S") 210 bedticket.bed_coordinates = u'-- booking cancelled on %s --' % timestamp 212 timestamp = now(tz).strftime("%Y-%m-%d %H:%M:%S %z %Z") 213 bedticket.bed_coordinates = u'-- booking cancelled on %s --' % ( 214 timestamp,) 211 215 return old_owner 212 216 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r7811 r8186 284 284 self.browser.contents) 285 285 self.assertMatches(bedticket.bed_coordinates, 286 u' -- booking cancelled on <YYYY-MM-DD hh:mm:ss > --')286 u' -- booking cancelled on <YYYY-MM-DD hh:mm:ss TZ> --') 287 287 # If we release a free be, nothing will happen 288 288 ctrl = self.browser.getControl(name='val_id')
Note: See TracChangeset for help on using the changeset viewer.