mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 11:33:55 +03:00
Updated Django converter
This commit is contained in:
parent
5cb5d9d65a
commit
bd41abcb5a
|
@ -94,7 +94,11 @@ def convert_onetoone_field_to_djangomodel(field, registry=None):
|
|||
model = get_related_model(field)
|
||||
|
||||
def dynamic_type():
|
||||
return Field(registry.get_type_for_model(model))
|
||||
_type = registry.get_type_for_model(model)
|
||||
if not _type:
|
||||
return
|
||||
|
||||
return Field(_type)
|
||||
|
||||
return Dynamic(dynamic_type)
|
||||
|
||||
|
@ -141,6 +145,9 @@ def convert_field_to_djangomodel(field, registry=None):
|
|||
|
||||
def dynamic_type():
|
||||
_type = registry.get_type_for_model(model)
|
||||
if not _type:
|
||||
return
|
||||
|
||||
return Field(_type, description=field.help_text)
|
||||
|
||||
return Dynamic(dynamic_type)
|
||||
|
|
|
@ -43,7 +43,7 @@ class DjangoObjectTypeMeta(ObjectTypeMeta):
|
|||
name=name,
|
||||
description=attrs.pop('__doc__', None),
|
||||
model=None,
|
||||
fields=None,
|
||||
local_fields=None,
|
||||
only_fields=(),
|
||||
exclude_fields=(),
|
||||
interfaces=(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user