华清大学特普通奖学金初选报名系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
495 B

  1. # coding: utf-8
  2. from openpyxl import Workbook
  3. from app import *
  4. wb = Workbook()
  5. ws = wb.active
  6. ws.title = '提名'
  7. ws.append(['编号', '是否正式提名', '赞数', '字数'])
  8. candidates = Candidate.query.all()
  9. for candidate in candidates:
  10. ws.append([candidate.id,
  11. (candidate.id == 68) or (len(candidate.private) > 0 and candidate.id not in {3, 9, 62}),
  12. Like.query.filter_by(cid = candidate.id).count(),
  13. len(candidate.content)])
  14. wb.save('nominations.xlsx')