Django Model related_name

52 views
Skip to first unread message

Justin Kpakpa

unread,
Sep 6, 2022, 6:22:26 AM9/6/22
to django...@googlegroups.com
Hello, pls under what circumstances do you need to defined a related_name of a model field?

DJANGO DEVELOPER

unread,
Sep 6, 2022, 8:18:36 AM9/6/22
to Django users
when you want to fetch multiple objects from that model ( having a foreign key relation)

On Tue, Sep 6, 2022 at 3:21 PM Justin Kpakpa <days...@gmail.com> wrote:
Hello, pls under what circumstances do you need to defined a related_name of a model field?

--
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/63171f1d.170a0220.87ca8.aef5%40mx.google.com.

Toshar Saini

unread,
Sep 8, 2022, 12:47:26 PM9/8/22
to django...@googlegroups.com
when you want to fetch multiple objects from reverse relation(foriengkey)

On Tue, Sep 6, 2022 at 3:51 PM Justin Kpakpa <days...@gmail.com> wrote:
Hello, pls under what circumstances do you need to defined a related_name of a model field?

Reply all
Reply to author
Forward
0 new messages