mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-06 06:30:36 +03:00
Fixed Cookbook. Fixed #68
This commit is contained in:
parent
401af42a55
commit
22b33214a7
|
@ -12,7 +12,6 @@ class CategoryNode(DjangoObjectType):
|
||||||
model = Category
|
model = Category
|
||||||
interfaces = (Node, )
|
interfaces = (Node, )
|
||||||
filter_fields = ['name', 'ingredients']
|
filter_fields = ['name', 'ingredients']
|
||||||
filter_order_by = ['name']
|
|
||||||
|
|
||||||
|
|
||||||
class IngredientNode(DjangoObjectType):
|
class IngredientNode(DjangoObjectType):
|
||||||
|
@ -27,7 +26,6 @@ class IngredientNode(DjangoObjectType):
|
||||||
'category': ['exact'],
|
'category': ['exact'],
|
||||||
'category__name': ['exact'],
|
'category__name': ['exact'],
|
||||||
}
|
}
|
||||||
filter_order_by = ['name', 'category__name']
|
|
||||||
|
|
||||||
|
|
||||||
class Query(AbstractType):
|
class Query(AbstractType):
|
||||||
|
|
|
@ -9,7 +9,7 @@ class RecipeNode(DjangoObjectType):
|
||||||
model = Recipe
|
model = Recipe
|
||||||
interfaces = (Node, )
|
interfaces = (Node, )
|
||||||
filter_fields = ['title','amounts']
|
filter_fields = ['title','amounts']
|
||||||
filter_order_by = ['title']
|
|
||||||
|
|
||||||
class RecipeIngredientNode(DjangoObjectType):
|
class RecipeIngredientNode(DjangoObjectType):
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class RecipeIngredientNode(DjangoObjectType):
|
||||||
'recipe': ['exact'],
|
'recipe': ['exact'],
|
||||||
'recipe__title': ['icontains'],
|
'recipe__title': ['icontains'],
|
||||||
}
|
}
|
||||||
filter_order_by = ['ingredient__name', 'recipe__title',]
|
|
||||||
|
|
||||||
class Query(AbstractType):
|
class Query(AbstractType):
|
||||||
recipe = Node.Field(RecipeNode)
|
recipe = Node.Field(RecipeNode)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user