mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-01-30 19:24:08 +03:00
Remove an unneeded backup file
Signed-off-by: drzix <korea.drzix@gmail.com>
This commit is contained in:
parent
c3609f9200
commit
810de7b26a
|
@ -1,33 +0,0 @@
|
||||||
from cookbook.ingredients.models import Recipe, Ingredient
|
|
||||||
from graphene import AbstractType, Node
|
|
||||||
from graphene_django.filter import DjangoFilterConnectionField
|
|
||||||
from graphene_django.types import DjangoObjectType
|
|
||||||
|
|
||||||
class RecipeNode(DjangoObjectType):
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Recipe
|
|
||||||
interfaces = (Node, )
|
|
||||||
filter_fields = ['name', 'ingredients']
|
|
||||||
filter_order_by = ['name']
|
|
||||||
|
|
||||||
class RecipeIngredientNode(DjangoObjectType):
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = RecipeIngredient
|
|
||||||
# Allow for some more advanced filtering here
|
|
||||||
interfaces = (Node, )
|
|
||||||
filter_fields = {
|
|
||||||
'name': ['exact', 'icontains', 'istartswith'],
|
|
||||||
'notes': ['exact', 'icontains'],
|
|
||||||
'recipe': ['exact'],
|
|
||||||
'recipe__name': ['icontains'],
|
|
||||||
}
|
|
||||||
filter_order_by = ['name', 'recipe__name',]
|
|
||||||
|
|
||||||
class Query(AbstractType):
|
|
||||||
recipe = Node.Field(RecipeNode)
|
|
||||||
all_categories = DjangoFilterConnectionField(RecipeNode)
|
|
||||||
|
|
||||||
recipeingredient = Node.Field(IngredientNode)
|
|
||||||
all_recipeingredients = DjangoFilterConnectionField(RecipeIngredientNode)
|
|
Loading…
Reference in New Issue
Block a user