def create_a_delivery(self): delivery = Delivery() delivery.file = self.delivery_filepath delivery.student = Student.objects.get(uid=self.student_name) course = Course.objects.get(name=self.course_name) delivery.practice = Practice.objects.get(course=course, uid=self.practice_uid) delivery.deliverDate = self.delivery_date delivery.save()
def create_a_delivery(delivery_filepath, student_name, course_name, practice_uid, delivery_date): delivery = Delivery() delivery.file = delivery_filepath delivery.student = Student.objects.get(uid=student_name) course = Course.objects.get(name=course_name) delivery.practice = Practice.objects.get(course=course, uid=practice_uid) delivery.deliverDate = delivery_date delivery.save() return delivery