graphene-django/graphene_django/tests/mutations.py
Ignacio Orlandini 8f63199a63
Handle database transactions (#1039)
* Handle Django database atomic requests

* Create and handle database atomic mutations

* Make code compatible with Python 2.7

* Code style

* Define set_rollback instead of using the one in rest_framework.views because of backward compatibility

* Implement mock.patch.dict
2020-12-22 20:18:14 -08:00

19 lines
377 B
Python

from graphene import Field
from graphene_django.forms.mutation import DjangoFormMutation, DjangoModelFormMutation
from .forms import PetForm
from .types import PetType
class PetFormMutation(DjangoFormMutation):
class Meta:
form_class = PetForm
class PetMutation(DjangoModelFormMutation):
pet = Field(PetType)
class Meta:
form_class = PetForm