Try using nested serializer or switch to graphql api for this specific task.

On Sun, Oct 27, 2024, 12:50 AM David James Nwoyie <
[email protected]> wrote:

> good morning,  everyone  i have this project that I'm working on ,the
> project is foodapp where food vendor can register their eatery and
> customers will register and then  place their order  I'm using django,drf
> for backend and nextjs for frontend but the problem I'm having is that,I
> can't create something with that has relation shipwith other tables in the
> django model for example the restaurant and menu item has relation which is
> foreignkey  but when i create the  menu item from the frontend it will
> return 500 or 401 but when I create with drf it works, how can i connect my
> backend  with tables that share realtionship(foreignkey) to the frontend so
> that i can post(create) from the frontend to the backend
>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/django-users/ef66e6ed-afba-4ab8-b5f7-3511e548df3an%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ef66e6ed-afba-4ab8-b5f7-3511e548df3an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-users/CAN1sNpBKQOo6pcqJ-KE5bK549kWrUtQ-%3DMSEMoby6zhGPibLvw%40mail.gmail.com.

Reply via email to