help creating a multi-level nested serializer

14 views
Skip to first unread message

ola neat

unread,
Jul 21, 2021, 7:21:42 AM7/21/21
to django...@googlegroups.com
good day fellaz,
i'm working on creating a multi-level serializer, where user will have profile & profile will have something else (another model), but im encountering an err below is my code snippet and err msg im getting hoping anyone can help

image.png

image.png

image.png
image.png

hussamdt

unread,
Jul 21, 2021, 9:29:10 AM7/21/21
to django...@googlegroups.com
You are making user property... But refer to profile model (table)
In serializer you pass a user at the time PrincipleDetail is expecting Profile instance,

I recommend you before every to naming your property correctly.. so you can debig your code better (user property refer to User model)

If you want to refer to Profile so do name you property somthing related like (profile)

Regards

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHLKn700TrgivFii2qUZNrfQQA5U1PgZjHbKECNJn2BOU6%2BvQQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages