From 346f93fc501e37c5fbd0a81e79bf9125272f13fa Mon Sep 17 00:00:00 2001 From: Anthony Monthe Date: Sun, 6 May 2018 18:34:37 +0100 Subject: [PATCH] Added auto M2M --- graphene_django/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphene_django/utils.py b/graphene_django/utils.py index f8d83bf..e8e14cc 100644 --- a/graphene_django/utils.py +++ b/graphene_django/utils.py @@ -43,8 +43,9 @@ def get_model_fields(model): local_fields = [ (field.name, field) for field - in sorted(list(model._meta.fields) + - list(model._meta.local_many_to_many)) + in sorted(set(list(model._meta.fields) + + list(model._meta.many_to_many) + + list(model._meta.local_many_to_many))) ] # Make sure we don't duplicate local fields with "reverse" version