Ignore:
Timestamp:
1 Apr 2008, 16:01:27 (17 years ago)
Author:
joachim
Message:

sort correctly by date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_upload/uploads_index.py

    r3332 r3403  
    8888        if getattr(doc,'import_date',''):
    8989            row['import_date'] = doc.import_date.strftime("%d/%m/%y %H:%M:%S")
     90            row['import_date_for_sort'] = doc.import_date.strftime("%y/%m/%d %H:%M:%S")
    9091        else:
    9192            row['import_date'] = ''
     
    99100    row['import_layout'] = doc.import_layout
    100101    row['uploaded_by'] =  doc.uploaded_by
     102    row['upload_date_for_sort'] =  doc.upload_date.strftime("%y/%m/%d %H:%M:%S")
    101103    row['upload_date'] =  doc.upload_date.strftime("%d/%m/%y %H:%M:%S")
    102104    row['imported_by'] = doc.imported_by
    103105    add_to.append(row)
    104 wrong.sort(cmp,key=lambda d:d['upload_date'],reverse=1)
    105 importable.sort(cmp,key=lambda d:d['upload_date'],reverse=1)
    106 imported.sort(cmp,key=lambda d:d['import_date'],reverse=1)
     106wrong.sort(cmp,key=lambda d:d['upload_date_for_sort'],reverse=1)
     107importable.sort(cmp,key=lambda d:d['upload_date_for_sort'],reverse=1)
     108imported.sort(cmp,key=lambda d:d['import_date_for_sort'],reverse=1)
    107109info['wrong'] = wrong
    108110info['imported'] = imported
Note: See TracChangeset for help on using the changeset viewer.