add examples to openapi schema, some perf improvements

This commit is contained in:
collerek
2021-04-30 16:46:41 +02:00
parent 734c33920b
commit 12c002776b
11 changed files with 194 additions and 78 deletions

View File

@ -48,7 +48,7 @@ class RelationMixin:
:return: list of related fields
:rtype: List
"""
if isinstance(cls._related_fields, List):
if cls._related_fields is not None:
return cls._related_fields
related_fields = []
@ -66,7 +66,7 @@ class RelationMixin:
:return: set of related through fields names
:rtype: Set
"""
if isinstance(cls._through_names, Set):
if cls._through_names is not None:
return cls._through_names
related_names = set()
@ -86,7 +86,7 @@ class RelationMixin:
:return: set of related fields names
:rtype: Set
"""
if isinstance(cls._related_names, Set):
if cls._related_names is not None:
return cls._related_names
related_names = set()