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
On Wed, 21 Jul 2021, 18:20 ola neat, <tosinayoola0@gmail.com> wrote:
--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
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHLKn700TrgivFii2qUZNrfQQA5U1PgZjHbKECNJn2BOU6%2BvQQ%40mail.gmail.com.
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM38xXR_H0o7SRRTTgZvdh7W0Z3TkMHnFoNRiXCMk6-BLyQuNA%40mail.gmail.com.
No comments:
Post a Comment