PreLoad Django Model With a list of values to go into a ManytoMany Field

I have three Models: Standard, Assignment Curriculum

Assignment has a foreign key to Curriculum, related_name = curriculum_assignment

Assignment has a ManyToMany field to Standard, related_name=standard_assignment

I want to preload assignment records from a CSV for all of my assignments, including the curriculum and standard fields.

I have this code, but need it corrected:


def assignment_upload(request):

template = "[login to view URL]"

prompt = {

'order':"The columns should be: Name, Instructions or Link, Curriculum, Standard."


if [login to view URL] == "GET":

return render (request, template, prompt)

csv_file = [login to view URL]['file']

if not [login to view URL]('.csv'):

[login to view URL](request, "Only CSV files may be uploaded.")

data_set = [login to view URL]().decode("UTF-8")

#for row in data_set:

io_string = [login to view URL](data_set)


for column in [login to view URL](io_string, delimiter=',', quotechar="|"):

obj_c, curriculum = Curriculum.objects.update_or_create(...)

obj_a, created = Assignment.objects.update_or_create(

name = column[1],

description = column [2],


standard = column [3],


return redirect ("/assignment")

context = {}

return render(request, template, context)

Квалификация: Python, Javascript, Django, Архитектура ПО

Показать больше calculate beta list values, largest model mayhem list, php drop list values table mysql, php form retain values hidden field, insert values hidden field database php, sharepoint list view cut field, show values form field javascript, year model drop list, excel permutation list values, year model website list, car model drop list, model mayhem list, global country state city list values, car brand model drop list javascript, as2 edit list values, cars model drop list, display list values extjs grid java, php mysql drop list values select option display details table

О работодателе:
( 5 отзыв(-а, -ов) ) WESTVILLE, United States

ID проекта: #21749480



Hi. there I’m grateful that you spared a part of your precious time for having a look at my proposal. I am a Fullstack Python Developer expertise in all the technologies required for your project. Being a remote freel Больше

$20 USD за 2 дней(-я)
(3 отзывов(-а))

5 фрилансеров(-а) в среднем готовы выполнить эту работу за $22


⭐⭐⭐ Dear client. ⭐⭐⭐ How are you Doing, Hope you are doing Great. I believe you still searching for Freelancer to handover your highly desirable work. I am sure i can take that Highly valuable Work and Finish on Time. Больше

$20 USD за 7 дней(-я)
(60 отзывов(-а))

Hi, sir. I have read your project description and found that i am best qualified for your job. I am always available any time for your project and i have many skilles that fullfill your project. Plz contact with me and Больше

$20 USD за 7 дней(-я)
(9 отзывов(-а))

Hey, I am an experienced python and script developer. Love to work on your project. message me for further discussion.

$25 USD за 3 дней(-я)
(0 отзывов(-а))

Hello, I am a Full stack web developer, experienced in Django, ASP.NET and PHP, i have read your code and i guess you're trying to read an CSV and insert values into your database, your problem is simple to solve usi Больше

$25 USD за 1 день
(0 отзывов(-а))