From e5e1ceb70e391411156950aab67aa83333dac177 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 06:13:56 +0000 Subject: automatic import of python-graphene-django-cud --- .gitignore | 1 + python-graphene-django-cud.spec | 335 ++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 337 insertions(+) create mode 100644 python-graphene-django-cud.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..9b0ed49 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/graphene-django-cud-0.10.0.tar.gz diff --git a/python-graphene-django-cud.spec b/python-graphene-django-cud.spec new file mode 100644 index 0000000..796175d --- /dev/null +++ b/python-graphene-django-cud.spec @@ -0,0 +1,335 @@ +%global _empty_manifest_terminate_build 0 +Name: python-graphene-django-cud +Version: 0.10.0 +Release: 1 +Summary: Create, update and delete mutations for graphene-django +License: MIT License +URL: https://github.com/tOgg1/graphene-django-cud +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/87/1d/906578f55b2319c733fa056c5f406cdb8a7b7e633fb3a55cbed3bbf9ce5e/graphene-django-cud-0.10.0.tar.gz +BuildArch: noarch + +Requires: python3-graphene-django +Requires: python3-graphene-file-upload + +%description +# Graphene Django CUD + +![Version](https://img.shields.io/pypi/v/graphene-django-cud) +![Build status](https://travis-ci.org/tOgg1/graphene-django-cud.svg?branch=develop) +[![Documentation Status](https://readthedocs.org/projects/graphene-django-cud/badge/?version=latest)](https://graphene-django-cud.readthedocs.io/en/latest/?badge=latest) +![License](https://img.shields.io/github/license/tOgg1/graphene-django-cud) + +This package contains a number of helper mutations making it easy to construct create, update and delete mutations for django models. + +The helper mutations are: + * `DjangoCreateMutation` + * `DjangoPatchMutation` + * `DjangoUpdateMutation` + * `DjangoDeleteMutation` + * `DjangoBatchCreateMutation` + * `DjangoBatchPatchMutation` + * `DjangoBatchUpdateMutation` + * `DjangoBatchDeleteMutation` + * `DjangoFilterUpdateMutation` + * `DjangoFilterDeleteMutation` + +The package handles both regular ids and relay ids automatically. + +## Installation + +`pip install graphene_django_cud` + +## Basic usage + +To use, here illustrated by `DjangoCreateMutation`, simply create a new inherting class. +Suppose we have the following model and Node. + +```python +class User(models.Model): + name = models.CharField(max_length=255) + address = models.TextField() + +class UserNode(DjangoObjectType): + class Meta: + model = User + interfaces = (Node,) +``` + +Then we can create a create mutation with the following schema + +```python +class CreateUserMutation(DjangoCreateMutation): + class Meta: + model = User + + +class Mutation(graphene.ObjectType): + create_user = CreateUserMutation.Field() + + +class Query(graphene.ObjectType): + user = graphene.Field(UserNode, id=graphene.String()) + + def resolve_user(self, info, id): + return User.objects.get(pk=id) + + +schema = Schema(query=Query, mutation=Mutation) +``` + +Note that the `UserNode` has to be registered as a field before the mutation is instantiated. This will be configurable in the future. + +The input to the mutation is a single variable `input` which is automatically created with the models fields. +An example mutation would then be + +```graphql +mutation { + createUser(input: {name: "John Doe", address: "Downing Street 10"}){ + user{ + id + name + address + } + } +} +``` + +## Documentation + +The full documentation can be found at https://graphene-django-cud.readthedocs.io/en/latest/. + + + + +%package -n python3-graphene-django-cud +Summary: Create, update and delete mutations for graphene-django +Provides: python-graphene-django-cud +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-graphene-django-cud +# Graphene Django CUD + +![Version](https://img.shields.io/pypi/v/graphene-django-cud) +![Build status](https://travis-ci.org/tOgg1/graphene-django-cud.svg?branch=develop) +[![Documentation Status](https://readthedocs.org/projects/graphene-django-cud/badge/?version=latest)](https://graphene-django-cud.readthedocs.io/en/latest/?badge=latest) +![License](https://img.shields.io/github/license/tOgg1/graphene-django-cud) + +This package contains a number of helper mutations making it easy to construct create, update and delete mutations for django models. + +The helper mutations are: + * `DjangoCreateMutation` + * `DjangoPatchMutation` + * `DjangoUpdateMutation` + * `DjangoDeleteMutation` + * `DjangoBatchCreateMutation` + * `DjangoBatchPatchMutation` + * `DjangoBatchUpdateMutation` + * `DjangoBatchDeleteMutation` + * `DjangoFilterUpdateMutation` + * `DjangoFilterDeleteMutation` + +The package handles both regular ids and relay ids automatically. + +## Installation + +`pip install graphene_django_cud` + +## Basic usage + +To use, here illustrated by `DjangoCreateMutation`, simply create a new inherting class. +Suppose we have the following model and Node. + +```python +class User(models.Model): + name = models.CharField(max_length=255) + address = models.TextField() + +class UserNode(DjangoObjectType): + class Meta: + model = User + interfaces = (Node,) +``` + +Then we can create a create mutation with the following schema + +```python +class CreateUserMutation(DjangoCreateMutation): + class Meta: + model = User + + +class Mutation(graphene.ObjectType): + create_user = CreateUserMutation.Field() + + +class Query(graphene.ObjectType): + user = graphene.Field(UserNode, id=graphene.String()) + + def resolve_user(self, info, id): + return User.objects.get(pk=id) + + +schema = Schema(query=Query, mutation=Mutation) +``` + +Note that the `UserNode` has to be registered as a field before the mutation is instantiated. This will be configurable in the future. + +The input to the mutation is a single variable `input` which is automatically created with the models fields. +An example mutation would then be + +```graphql +mutation { + createUser(input: {name: "John Doe", address: "Downing Street 10"}){ + user{ + id + name + address + } + } +} +``` + +## Documentation + +The full documentation can be found at https://graphene-django-cud.readthedocs.io/en/latest/. + + + + +%package help +Summary: Development documents and examples for graphene-django-cud +Provides: python3-graphene-django-cud-doc +%description help +# Graphene Django CUD + +![Version](https://img.shields.io/pypi/v/graphene-django-cud) +![Build status](https://travis-ci.org/tOgg1/graphene-django-cud.svg?branch=develop) +[![Documentation Status](https://readthedocs.org/projects/graphene-django-cud/badge/?version=latest)](https://graphene-django-cud.readthedocs.io/en/latest/?badge=latest) +![License](https://img.shields.io/github/license/tOgg1/graphene-django-cud) + +This package contains a number of helper mutations making it easy to construct create, update and delete mutations for django models. + +The helper mutations are: + * `DjangoCreateMutation` + * `DjangoPatchMutation` + * `DjangoUpdateMutation` + * `DjangoDeleteMutation` + * `DjangoBatchCreateMutation` + * `DjangoBatchPatchMutation` + * `DjangoBatchUpdateMutation` + * `DjangoBatchDeleteMutation` + * `DjangoFilterUpdateMutation` + * `DjangoFilterDeleteMutation` + +The package handles both regular ids and relay ids automatically. + +## Installation + +`pip install graphene_django_cud` + +## Basic usage + +To use, here illustrated by `DjangoCreateMutation`, simply create a new inherting class. +Suppose we have the following model and Node. + +```python +class User(models.Model): + name = models.CharField(max_length=255) + address = models.TextField() + +class UserNode(DjangoObjectType): + class Meta: + model = User + interfaces = (Node,) +``` + +Then we can create a create mutation with the following schema + +```python +class CreateUserMutation(DjangoCreateMutation): + class Meta: + model = User + + +class Mutation(graphene.ObjectType): + create_user = CreateUserMutation.Field() + + +class Query(graphene.ObjectType): + user = graphene.Field(UserNode, id=graphene.String()) + + def resolve_user(self, info, id): + return User.objects.get(pk=id) + + +schema = Schema(query=Query, mutation=Mutation) +``` + +Note that the `UserNode` has to be registered as a field before the mutation is instantiated. This will be configurable in the future. + +The input to the mutation is a single variable `input` which is automatically created with the models fields. +An example mutation would then be + +```graphql +mutation { + createUser(input: {name: "John Doe", address: "Downing Street 10"}){ + user{ + id + name + address + } + } +} +``` + +## Documentation + +The full documentation can be found at https://graphene-django-cud.readthedocs.io/en/latest/. + + + + +%prep +%autosetup -n graphene-django-cud-0.10.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-graphene-django-cud -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 0.10.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..a0897ba --- /dev/null +++ b/sources @@ -0,0 +1 @@ +2c4c70fb3c6971e93904faad1722ae69 graphene-django-cud-0.10.0.tar.gz -- cgit v1.2.3