Пример #1
0
def generate(user, courses, selected, destructive) :
	grouped = list()
	for course in courses :
		day, month, year = course.date.split(".")
		month = Config.Months[month]
		if [month, year] in selected :
			if year not in _keys(grouped) :
				grouped.append((year, list()))
			if month not in _keys(_values(grouped, year)) :
				_values(grouped, year).append((month, list()))
			_values(_values(grouped, year), month).append(course)
			if destructive :
				Database.deleteCourse(user.username, course.id)
	return storeWithId(user, grouped)
Пример #2
0
def delete(username, id) :
	Database.deleteCourse(username, id)