mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
added support convertion for neomodel relationship
This commit is contained in:
parent
59f73c7f27
commit
e4fa8fe0b7
|
@ -114,6 +114,8 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
_parent = is_parent_set(info)
|
||||
|
||||
def new_resolver(root, info, **args):
|
||||
|
||||
#filters
|
||||
filters = dict(filter(lambda x: '__' in x[0], args.items()))
|
||||
qs = resolver(root, info, **args)
|
||||
if qs is None:
|
||||
|
@ -125,6 +127,8 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
if order:
|
||||
qs = qs.order_by(order)
|
||||
|
||||
# set parent to child fields
|
||||
# in ''_parent'' attribute
|
||||
if _parent and root is not None:
|
||||
instances = []
|
||||
for instance in qs:
|
||||
|
|
|
@ -35,6 +35,8 @@ from neomodel import (
|
|||
One,
|
||||
OneOrMore,
|
||||
)
|
||||
from neomodel.relationship_manager import RelationshipDefinition
|
||||
|
||||
|
||||
@convert_form_field.register(StringProperty)
|
||||
@convert_form_field.register(RegexProperty)
|
||||
|
@ -43,6 +45,7 @@ def convert_form_field_to_string(field):
|
|||
|
||||
|
||||
@convert_form_field.register(forms.UUIDField)
|
||||
@convert_form_field.register(RelationshipDefinition)
|
||||
def convert_form_field_to_uuid(field):
|
||||
return UUID(description=field.help_text)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user