def create_a_practice(self): practice = Practice() practice.course = Course.objects.get(name=self.course_name) practice.deadline = self.practice_deadline practice.file = self.practice_filepath practice.uid = self.practice_uid practice.save()
def create_a_practice(course_name, practice_deadline, practice_filepath, practice_uid): practice = Practice() practice.course = Course.objects.get(name=course_name) practice.deadline = practice_deadline practice.file = practice_filepath practice.uid = practice_uid practice.save() return practice