def to_internal_value(self, data): """ Convert data into CourseVideo instance and image filename tuple. """ course_id = data course_video = image = '' if data: if isinstance(data, dict): (course_id, image), = data.items() course_video = CourseVideo(course_id=course_id) course_video.full_clean(exclude=['video']) return course_video, image
def to_internal_value(self, data): if data: course_video = CourseVideo(course_id=data) course_video.full_clean(exclude=["video"]) return course_video