## Script (Python) "getFormattedBed" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=bed=None,mode=None,datastructure=None ##title= # $Id: getFormattedBedOkene.py 5582 2010-11-10 08:56:03Z henrik $ """ format the bed for readability """ try: from Products.zdb import set_trace except: def set_trace(): pass if datastructure is not None: bed = datastructure.get('bed') bed_paid = datastructure.get('acco_maint_date') if not bed: return '' if not bed_paid: return 'visible after payment' if len(bed.split('_')) != 4: return bed hall,block,room,letter = bed.split('_') info = context.waeup_tool.getHallInfo(bed) if info: hall_title = info['hall_title'] else: hall_title = '[%s]' % hall return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)