Skip to content
Advertisement

Accessing model field in ManyToMany relation in Django

I am following the example in the documentation: https://docs.djangoproject.com/en/3.2/topics/db/models/#extra-fields-on-many-to-many-relationships

JavaScript

In this case, given a Person object, how can I access all the groups that Person is in?

Advertisement

Answer

You access these with:

JavaScript
Advertisement