Ignore:
Timestamp:
23 Oct 2007, 20:00:45 (17 years ago)
Author:
Henrik Bettermann
Message:

downloads all halls if called from the accommodation root

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_accommodation/hall_allocation_list.py

    r2425 r2426  
    3838lines.append(','.join(fields))
    3939format = '"%(' + ')s","%('.join(fields) + ')s"'
    40 hall=context.getId()
    41 booked = pa(hall=hall)
     40hallid=context.getId()
     41booked = pa(hall=hallid)
     42if not booked:
     43    hallid = 'all_halls'
     44    booked = pa()
    4245for bed in booked:
    4346    if bed.student == '':
     
    4750        continue
    4851    d = context.getFormattedStudentEntry(erg[0])
    49     hall_dummy,block,room,bed = bed.bed.split('_')
     52    hall,block,room,bed = bed.bed.split('_')
    5053    d['hall'] = hall
    5154    d['block'] = block
     
    5659#setheader('Content-type','application/vnd.ms-excel')
    5760setheader('Content-type','text/semicolon-seperated-values')
    58 setheader('Content-Disposition:', 'attachment; filename="%s.csv"' % hall)
     61setheader('Content-Disposition:', 'attachment; filename="%s.csv"' % hallid)
    5962setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
    6063setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
Note: See TracChangeset for help on using the changeset viewer.