need help with update function of nested serializers

def update(self, instance, validated_data):
# recupero i dati dalla request
data = self.context['request'].data
instance = EvaluationTest()
# admin non necessario, genera errore perchè il numero degli argomenti restituiti non
# corrisponde a quelli richiesti
admin = User.objects.get(username=data['admin'])
questions = QuestionSerializer()
choices = StringSerializer()
# utilizzo il valore di category(recuperato dalla request) per aggiornare la categoria associata
cat = Category.objects.get(id=data['category'])

instance.category = cat

instance.category = validated_data.get('id', instance.category)
instance.title = validated_data.get('title', instance.title)
instance.type = validated_data.get('type', instance.type)
instance.admin = admin
instance.save()

# instance = evaluationtest()
keep_questions = []
# questions = validated_data.get('questions')
for question in data['questions']:
print(question)
if "id" in questions:
if Question.objects.filter(id=questions["id"]).exists():
q = Question.objects.get(id=questions["id"])
q.question = question.get('question', q.question)
q.save()
else:
continue
# else:
# q = Question.objects.create(
# **questions, evaluationtest=instance)
keep_questions.append(q.id)
# for question in instance.questions:
# if question.id not in keep_questions:
# question.delete()
keep_choices = []
# choices = validated_data.get('choices')
for choice in question['choices']:
if "id" in choice:
if Choice.objects.filter(id=choice["id"]).exists():
c = Choice.objects.get(id=choice["id"])
c.title = choice.get('title', c.title)
c.save()
else:
continue
# else:
# c = Choice.objects.create(
# **choice, questions=choices)
keep_choices.append(c.id)
# for choice in questions.choices:
# if choice.id not in keep_choices:
# choice.delete()

# order = 1
# for q in instance['questions']:
# newQ = Question()
# newQ.question=q['title']
# newQ.order = order
# newQ.save()

# for c in q['choices']:
# newC = Choice()
# newC.title = c
# newC.save()
# newQ.choices.add(newC)
# newQ.answer = Choice.objects.get(title=q['answer'])
# newQ.instance = instance
# newQ.save()
# order += 1
return instance

Features currently being evaluated

FeatureDescription
Private rooms
Comet Comet is a form of reverse-ajax. See
http://en.wikipedia.org/wiki/Comet_%28programming%29
WebSockets
Package django-socketio django-private-chat chatire Gnotty django-chatrooms chat django-bot django-chant django-ajax-chat django-live djangotribune Django Chatter django-jqchat django-tawkto django-chat
Package django-socketio django-private-chat chatire Gnotty django-chatrooms chat django-bot django-chant django-ajax-chat django-live djangotribune Django Chatter django-jqchat django-tawkto django-chat
Description WebSockets for Django Django one-to-one
Websocket-based
Asyncio-handled chat,
developed by Bearle team
:speech_balloon: Real time
Chat application built with
Vue, Django, RabbitMQ and
uWSGI WebSockets.
IRC web client and bot
framework
A django app providing
reverse-ajax chat rooms. Based
on gevent.
Tornado WebSocket chat for
your Django projects
A lightweight django framework
for bots
A simple django chat
application via pure
websockets and tornado
django ajax chat package Comet based chat for django. Django-tribune is a *chat-like
application*
A simple Chat App for Django
based on channels and
websockets
This project has been
transferred to Albano Manoni
(asswerus) who will continue
further development. Please
address any questions/bug
reports to ...
Tawk.to chat for django
CategoryAppAppProjectAppAppAppAppAppAppAppAppAppAppAppApp
# Using This431801411203002100
Python 3?
Development Status Beta Alpha n/a Beta Alpha n/a Unknown n/a Unknown Pre-Alpha Unknown Unknown Unknown Unknown n/a
Last updated Nov. 4, 2018, 5:44 p.m. March 31, 2019, 2:57 p.m. May 1, 2018, 2:47 p.m. Sept. 17, 2015, 7:38 p.m. July 28, 2015, 6:21 p.m. Nov. 26, 2012, 7:02 a.m. July 21, 2017, 8:42 p.m. March 31, 2014, 9:08 a.m. Oct. 26, 2017, 12:01 p.m. Feb. 24, 2012, 2:54 a.m. Nov. 4, 2017, 8:46 p.m. March 3, 2019, 1:59 a.m. May 12, 2014, 9:19 a.m. March 13, 2019, 12:57 a.m.
Version0.3.90.2.2n/a0.2.7n/an/a0.2.2n/a0.20.1.80.7.90.1.20.30.2n/a
RepoGithubGithubGithubGithubGithubGithubGithubGithubGithubBitbucketGithubGithubGithubGithubOther
Commits
Stars1179213205157913831262019181194n/a
Repo Forks2377552282420771138281n/a
Participantsstephenmcd
blancheta
dxe4
gmixo
Thibaut-Fatus
dzlabs
0xflotus
chrisspen
codekoala
galuszkak
more...
delneg
guitarmustafa
grantal
GauravJ3
123tarunanand
mekicha
karinakozarova
SimplyAhmazing
idonoso
zsmith3
danidee10
ihtiht
stephenmcd
mikeywaites
chrisfranklin
kenbolton
spaceone
qubird
roramirez
arusenishaileshahujanight-crawlersharan01nicoechanizsveetch
Meodudlye
remik
devnewton
ishtiaque06
dibs-devs
kkruto
asswerus
richardbarran
CleitonDeLima
Documentation N/A N/A N/A N/A N/A N/A N/A N/A N/A
Private rooms  django-socketio provides a chat application as an example app. 
But easily implementable
Comet 
Gevent
WebSockets 
Async, non-blocking, thread-on-request
No sockets. Each active chat polls every 8000ms for new messages.
Search WeightPackageDescriptionLast PyPI release:Repo ForksStars
{{ item.weight / max_weight * 100 | number:0 }}%{{ item.title }}Grid: {{ item.description }} {{ item.last_released | date: 'mediumDate' }} N/A {{ item.repo_forks }} N/A {{ item.repo_watchers }} N/A