WebMay 26, 2024 · 1 Answer Sorted by: 4 The Customer field should be a User instance, but you are passing a model instance to the Customer field while creating an AssistanceQuest. So change this Assistance = AssistanceQuest (Customer=user, Status= 'False',Request= Message, Tipology='Tecnica',Date_request=datetime.datetime.now ()) to WebApr 13, 2024 · Django : How to fix this error in Django, "Cannot assign must be an instance."To Access My Live Chat Page, On Google, Search for "hows tech developer connect...
Value Error. Cannot assign query set. It must be an instance
Web1 Answer Sorted by: 4 You should assign a User to the Comment.user field. You are currently assigning the id instead. You can either do: comment = Comment (user=author, … WebOct 7, 2024 · 1 I am trying to save this field from Forms.py, which seems to be causing this error: Cannot assign "": "Group.vehicles" must be a "Vehicle" instance. Everything saves correctly through … iowa hawkeyes vs ohio state football history
ValueError: Cannot assign "1": "Topic.board" must be a …
WebNov 30, 2024 · 1 Answer Sorted by: 0 obj = Percentages.objects.create ( major_cd = major_cd, perc = perc, ) When you do that, major_cd is the string "9999", it should be a Major instance. So you have to do, if you are sure the major_cd instance exists: obj = Percentages.objects.create ( major_cd = Major.objects.get (major_cd=int (major_cd)), … Web1 Answer Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) WebNov 29, 2011 · ValueError: Cannot assign in django. Ask Question Asked 11 years, 4 months ago. Modified 11 years, 4 months ago. Viewed 9k times 4 I have encountered a problem when I was trying to add/post a data to my models. this is what i have done in my python manage.py shell: ... "Booking.product" must be a "Product" instance. ... iowa hawkeyes vs ohio state buckeyes ats