Changeset 3292 for WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
- Timestamp:
- 9 Mar 2008, 12:47:17 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
r3291 r3292 1 ## Script (Python) " getUploadsInfo"1 ## Script (Python) "uploads_index" 2 2 ##bind container=container 3 3 ##bind context=context … … 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters= student=None7 ##parameters= 8 8 ##title= 9 9 ## 10 # $Id: getUploadsInfo.py 486 2006-09-06 10:09:39Z joachim $10 # $Id:uploads_index.py 486 2006-09-06 10:09:39Z joachim $ 11 11 """ 12 12 return Info about the Uploads … … 35 35 info['doc'] = context.getContent() 36 36 37 items = []38 37 edit = request.form.has_key('edit') 39 38 ids = request.get('ids',[]) … … 59 58 request.RESPONSE.redirect(context.absolute_url()) 60 59 60 wrong = [] 61 imported = [] 62 importable = [] 61 63 for id,upload in context.objectItems(): 64 add_to = wrong 62 65 row = {} 63 66 doc = upload.getContent() … … 67 70 row['title'] = doc.filename 68 71 row['url'] = upload.absolute_url() 69 row['msg'], row['invalid_keys'] = doc['checkKeys']() 72 row['imported'] = False 73 row['invalid_keys'] = [] 74 import_message = getattr(doc,'import_message','') 75 if import_message: 76 row['imported'] = True 77 row['msg'] = import_message 78 row['imported_at'] = doc.imported_at.strftime("%d/%m/%y %H:%M:%S") 79 add_to = imported 80 else: 81 row['msg'],row['invalid_keys'] = doc['checkKeys']() 82 if not row['msg'] and not row['invalid_keys']: 83 add_to = importable 70 84 row['filename'] = doc.filename 71 85 row['import_layout'] = doc.import_layout 72 86 row['upload_date'] = doc.upload_date.strftime("%d/%m/%y %H:%M:%S") 73 87 row['uploaded_by'] = doc.uploaded_by 74 items.append(row) 75 items.sort() 76 info['items'] = items 88 add_to.append(row) 89 wrong.sort() 90 imported.sort() 91 importable.sort() 92 info['wrong'] = wrong 93 info['imported'] = imported 94 info['importable'] = importable 77 95 78 96 validate = "upload" in request.keys()
Note: See TracChangeset for help on using the changeset viewer.