def add_project(course, row): date = make_aware(parse_date(row[2])) date = date_str(date) page = '%s/project/%s' % (course, row[0]) instructions = '/unc/%s/project/%s' % (course, row[0]) title = row[6] if row[6:] else 'None' return create_project(course, row[0], title, page, date, instructions)
def export_lessons(course): with open(lessons_csv(course), 'w') as f: for x in Lesson.list(course): text = ','.join([ course, str(x.lesson), x.topic, str(x.week), date_str(x.date), x.reading ]) f.write("%s\n" % text)
def task_history(insight): return 'Documents/info/history/%s' % date_str(insight.date).replace( '-', '/')
def print_projects(): for course in ['bacs200', 'bacs350']: print("\n%s" % c) for p in Project.list(course): print(" [%d] %s - due %s - %s" % (p.pk, p.title, date_str(p.due), p.page))
def export_projects(course): with open(project_csv(course), 'w') as f: for project in Project.list(course): f.write("%s,%s,%s,%s,%s\n" % (course, project.num, project.title, project.page, date_str(project.due)))
def assigned(a): return dict(title="Reading - %s" % a.reading, due=date_str(a.date), state='Not Completed')
def assigned(a): link = '<a href="/unc/%s/project/%02d">Project #%s</a>' % ( a.project.course.name, a.project.num, a.project.title) return dict(title=link, due=date_str(a.due), state=a.state)
def export_skills(course): with open(skills_csv(course), 'w') as f: for x in Skill.list(course): text = ','.join([course, str(x.num), x.topic, date_str(x.due), x.images]) f.write("%s\n" % text)