summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-12 07:05:03 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-12 07:05:03 +0000
commit7fc5bb581a472737109e0af8ec27b697ac460823 (patch)
tree4e209b466df647e043131d1bab122f7df9872a15
parent250006c704c18420f8aad5431be363999b9c36e9 (diff)
automatic import of python-django-restqlopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-django-restql.spec561
-rw-r--r--sources1
3 files changed, 563 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..e7ed2e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/django-restql-0.15.3.tar.gz
diff --git a/python-django-restql.spec b/python-django-restql.spec
new file mode 100644
index 0000000..dbfef01
--- /dev/null
+++ b/python-django-restql.spec
@@ -0,0 +1,561 @@
+%global _empty_manifest_terminate_build 0
+Name: python-django-restql
+Version: 0.15.3
+Release: 1
+Summary: Turn your API made with Django REST Framework(DRF) into a GraphQL like API.
+License: MIT
+URL: https://yezyilomo.github.io/django-restql
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/c9/38/5a9740df9a65a801b800aa47e2190dfe1a6ba9db7159ce34a9be00e28539/django-restql-0.15.3.tar.gz
+BuildArch: noarch
+
+Requires: python3-django
+Requires: python3-djangorestframework
+Requires: python3-pypeg2
+
+%description
+# <img height="24" src="https://raw.githubusercontent.com/yezyilomo/django-restql/master/docs/img/icon.svg" /> [ Django RESTQL](https://yezyilomo.github.io/django-restql)
+
+![Build Status](https://github.com/yezyilomo/django-restql/actions/workflows/main.yml/badge.svg?branch=master)
+[![Latest Version](https://img.shields.io/pypi/v/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![Python Versions](https://img.shields.io/pypi/pyversions/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![License](https://img.shields.io/pypi/l/django-restql.svg)](https://pypi.org/project/django-restql/)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+[![Downloads](https://pepy.tech/badge/django-restql)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/month)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/week)](https://pepy.tech/project/django-restql)
+
+
+**Django RESTQL** is a python library which allows you to turn your API made with **Django REST Framework(DRF)** into a GraphQL like API. With **Django RESTQL** you will be able to
+
+* Send a query to your API and get exactly what you need, nothing more and nothing less.
+
+* Control the data you get, not the server.
+
+* Get predictable results, since you control what you get from the server.
+
+* Get nested resources in a single request.
+
+* Avoid Over-fetching and Under-fetching of data.
+
+* Write(create & update) nested data of any level in a single request.
+
+Isn't it cool?.
+
+Want to see how this library is making all that possible?
+
+Check out the full documentation at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql)
+
+Or try a live demo on [Django RESTQL Playground](https://django-restql-playground.yezyilomo.me)
+
+
+## Requirements
+* Python >= 3.6
+* Django >= 1.11
+* Django REST Framework >= 3.5
+
+
+## Installing
+```py
+pip install django-restql
+```
+
+
+## Getting Started
+Using **Django RESTQL** to query data is very simple, you just have to inherit the `DynamicFieldsMixin` class when defining a serializer that's all.
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email']
+```
+
+**Django RESTQL** handle all requests with a `query` parameter, this parameter is the one used to pass all fields to be included/excluded in a response. For example to select `id` and `username` fields from User model, send a request with a ` query` parameter as shown below.
+
+`GET /users/?query={id, username}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo"
+ },
+ ...
+]
+```
+
+**Django RESTQL** support querying both flat and nested resources, so you can expand or query nested fields at any level as defined on a serializer. In an example below we have `location` as a nested field on User model.
+
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+from app.models import GroupSerializer, LocationSerializer
+
+
+class LocationSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = Location
+ fields = ['id', 'country', 'city', 'street']
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ location = LocationSerializer(many=False, read_only=True)
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email', 'location']
+```
+
+If you want only `country` and `city` fields on a `location` field when retrieving users here is how you can do it
+
+`GET /users/?query={id, username, location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "location": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+You can even rename your fields when querying data, In an example below the field `location` is renamed to `address`
+
+`GET /users/?query={id, username, address: location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "address": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+
+## [Documentation :pencil:](https://yezyilomo.github.io/django-restql)
+You can do a lot with **Django RESTQL** apart from querying data, like
+- Rename fields
+- Restrict some fields on nested fields
+- Define self referencing nested fields
+- Optimize data fetching on nested fields
+- Data filtering and pagination by using query arguments
+- Data mutation(Create and update nested data of any level in a single request)
+
+Full documentation for this project is available at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql), you are advised to read it inorder to utilize this library to the fullest.
+
+
+## [Django RESTQL Play Ground](https://django-restql-playground.yezyilomo.me)
+[**Django RESTQL Play Ground**](https://django-restql-playground.yezyilomo.me) is a graphical, interactive, in-browser tool which you can use to test **Django RESTQL** features like data querying, mutations etc to get the idea of how the library works before installing it. It's more like a [**live demo**](https://django-restql-playground.yezyilomo.me) for **Django RESTQL**, it's available at [https://django-restql-playground.yezyilomo.me](https://django-restql-playground.yezyilomo.me)
+
+
+## Running Tests
+`python runtests.py`
+
+
+## Credits
+* Implementation of this library is based on the idea behind [GraphQL](https://graphql.org/).
+* My intention is to extend the capability of [drf-dynamic-fields](https://github.com/dbrgn/drf-dynamic-fields) library to support more functionalities like allowing to query nested fields both flat and iterable at any level and allow writing on nested fields while maintaining simplicity.
+
+
+## Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
+
+We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/yezyilomo/django-restql/pulls) or as [GitHub issues](https://github.com/yezyilomo/django-restql/issues). If you'd like to improve code, check out the [Code Style Guide](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md#styleguides) and have a good time!.
+
+
+
+
+%package -n python3-django-restql
+Summary: Turn your API made with Django REST Framework(DRF) into a GraphQL like API.
+Provides: python-django-restql
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-django-restql
+# <img height="24" src="https://raw.githubusercontent.com/yezyilomo/django-restql/master/docs/img/icon.svg" /> [ Django RESTQL](https://yezyilomo.github.io/django-restql)
+
+![Build Status](https://github.com/yezyilomo/django-restql/actions/workflows/main.yml/badge.svg?branch=master)
+[![Latest Version](https://img.shields.io/pypi/v/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![Python Versions](https://img.shields.io/pypi/pyversions/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![License](https://img.shields.io/pypi/l/django-restql.svg)](https://pypi.org/project/django-restql/)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+[![Downloads](https://pepy.tech/badge/django-restql)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/month)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/week)](https://pepy.tech/project/django-restql)
+
+
+**Django RESTQL** is a python library which allows you to turn your API made with **Django REST Framework(DRF)** into a GraphQL like API. With **Django RESTQL** you will be able to
+
+* Send a query to your API and get exactly what you need, nothing more and nothing less.
+
+* Control the data you get, not the server.
+
+* Get predictable results, since you control what you get from the server.
+
+* Get nested resources in a single request.
+
+* Avoid Over-fetching and Under-fetching of data.
+
+* Write(create & update) nested data of any level in a single request.
+
+Isn't it cool?.
+
+Want to see how this library is making all that possible?
+
+Check out the full documentation at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql)
+
+Or try a live demo on [Django RESTQL Playground](https://django-restql-playground.yezyilomo.me)
+
+
+## Requirements
+* Python >= 3.6
+* Django >= 1.11
+* Django REST Framework >= 3.5
+
+
+## Installing
+```py
+pip install django-restql
+```
+
+
+## Getting Started
+Using **Django RESTQL** to query data is very simple, you just have to inherit the `DynamicFieldsMixin` class when defining a serializer that's all.
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email']
+```
+
+**Django RESTQL** handle all requests with a `query` parameter, this parameter is the one used to pass all fields to be included/excluded in a response. For example to select `id` and `username` fields from User model, send a request with a ` query` parameter as shown below.
+
+`GET /users/?query={id, username}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo"
+ },
+ ...
+]
+```
+
+**Django RESTQL** support querying both flat and nested resources, so you can expand or query nested fields at any level as defined on a serializer. In an example below we have `location` as a nested field on User model.
+
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+from app.models import GroupSerializer, LocationSerializer
+
+
+class LocationSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = Location
+ fields = ['id', 'country', 'city', 'street']
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ location = LocationSerializer(many=False, read_only=True)
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email', 'location']
+```
+
+If you want only `country` and `city` fields on a `location` field when retrieving users here is how you can do it
+
+`GET /users/?query={id, username, location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "location": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+You can even rename your fields when querying data, In an example below the field `location` is renamed to `address`
+
+`GET /users/?query={id, username, address: location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "address": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+
+## [Documentation :pencil:](https://yezyilomo.github.io/django-restql)
+You can do a lot with **Django RESTQL** apart from querying data, like
+- Rename fields
+- Restrict some fields on nested fields
+- Define self referencing nested fields
+- Optimize data fetching on nested fields
+- Data filtering and pagination by using query arguments
+- Data mutation(Create and update nested data of any level in a single request)
+
+Full documentation for this project is available at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql), you are advised to read it inorder to utilize this library to the fullest.
+
+
+## [Django RESTQL Play Ground](https://django-restql-playground.yezyilomo.me)
+[**Django RESTQL Play Ground**](https://django-restql-playground.yezyilomo.me) is a graphical, interactive, in-browser tool which you can use to test **Django RESTQL** features like data querying, mutations etc to get the idea of how the library works before installing it. It's more like a [**live demo**](https://django-restql-playground.yezyilomo.me) for **Django RESTQL**, it's available at [https://django-restql-playground.yezyilomo.me](https://django-restql-playground.yezyilomo.me)
+
+
+## Running Tests
+`python runtests.py`
+
+
+## Credits
+* Implementation of this library is based on the idea behind [GraphQL](https://graphql.org/).
+* My intention is to extend the capability of [drf-dynamic-fields](https://github.com/dbrgn/drf-dynamic-fields) library to support more functionalities like allowing to query nested fields both flat and iterable at any level and allow writing on nested fields while maintaining simplicity.
+
+
+## Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
+
+We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/yezyilomo/django-restql/pulls) or as [GitHub issues](https://github.com/yezyilomo/django-restql/issues). If you'd like to improve code, check out the [Code Style Guide](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md#styleguides) and have a good time!.
+
+
+
+
+%package help
+Summary: Development documents and examples for django-restql
+Provides: python3-django-restql-doc
+%description help
+# <img height="24" src="https://raw.githubusercontent.com/yezyilomo/django-restql/master/docs/img/icon.svg" /> [ Django RESTQL](https://yezyilomo.github.io/django-restql)
+
+![Build Status](https://github.com/yezyilomo/django-restql/actions/workflows/main.yml/badge.svg?branch=master)
+[![Latest Version](https://img.shields.io/pypi/v/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![Python Versions](https://img.shields.io/pypi/pyversions/django-restql.svg)](https://pypi.org/project/django-restql/)
+[![License](https://img.shields.io/pypi/l/django-restql.svg)](https://pypi.org/project/django-restql/)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+[![Downloads](https://pepy.tech/badge/django-restql)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/month)](https://pepy.tech/project/django-restql)
+[![Downloads](https://pepy.tech/badge/django-restql/week)](https://pepy.tech/project/django-restql)
+
+
+**Django RESTQL** is a python library which allows you to turn your API made with **Django REST Framework(DRF)** into a GraphQL like API. With **Django RESTQL** you will be able to
+
+* Send a query to your API and get exactly what you need, nothing more and nothing less.
+
+* Control the data you get, not the server.
+
+* Get predictable results, since you control what you get from the server.
+
+* Get nested resources in a single request.
+
+* Avoid Over-fetching and Under-fetching of data.
+
+* Write(create & update) nested data of any level in a single request.
+
+Isn't it cool?.
+
+Want to see how this library is making all that possible?
+
+Check out the full documentation at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql)
+
+Or try a live demo on [Django RESTQL Playground](https://django-restql-playground.yezyilomo.me)
+
+
+## Requirements
+* Python >= 3.6
+* Django >= 1.11
+* Django REST Framework >= 3.5
+
+
+## Installing
+```py
+pip install django-restql
+```
+
+
+## Getting Started
+Using **Django RESTQL** to query data is very simple, you just have to inherit the `DynamicFieldsMixin` class when defining a serializer that's all.
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email']
+```
+
+**Django RESTQL** handle all requests with a `query` parameter, this parameter is the one used to pass all fields to be included/excluded in a response. For example to select `id` and `username` fields from User model, send a request with a ` query` parameter as shown below.
+
+`GET /users/?query={id, username}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo"
+ },
+ ...
+]
+```
+
+**Django RESTQL** support querying both flat and nested resources, so you can expand or query nested fields at any level as defined on a serializer. In an example below we have `location` as a nested field on User model.
+
+```py
+from rest_framework import serializers
+from django.contrib.auth.models import User
+from django_restql.mixins import DynamicFieldsMixin
+
+from app.models import GroupSerializer, LocationSerializer
+
+
+class LocationSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ class Meta:
+ model = Location
+ fields = ['id', 'country', 'city', 'street']
+
+
+class UserSerializer(DynamicFieldsMixin, serializer.ModelSerializer):
+ location = LocationSerializer(many=False, read_only=True)
+ class Meta:
+ model = User
+ fields = ['id', 'username', 'email', 'location']
+```
+
+If you want only `country` and `city` fields on a `location` field when retrieving users here is how you can do it
+
+`GET /users/?query={id, username, location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "location": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+You can even rename your fields when querying data, In an example below the field `location` is renamed to `address`
+
+`GET /users/?query={id, username, address: location{country, city}}`
+```js
+[
+ {
+ "id": 1,
+ "username": "yezyilomo",
+ "address": {
+ "contry": "Tanzania",
+ "city": "Dar es salaam"
+ }
+ },
+ ...
+]
+```
+
+
+## [Documentation :pencil:](https://yezyilomo.github.io/django-restql)
+You can do a lot with **Django RESTQL** apart from querying data, like
+- Rename fields
+- Restrict some fields on nested fields
+- Define self referencing nested fields
+- Optimize data fetching on nested fields
+- Data filtering and pagination by using query arguments
+- Data mutation(Create and update nested data of any level in a single request)
+
+Full documentation for this project is available at [https://yezyilomo.github.io/django-restql](https://yezyilomo.github.io/django-restql), you are advised to read it inorder to utilize this library to the fullest.
+
+
+## [Django RESTQL Play Ground](https://django-restql-playground.yezyilomo.me)
+[**Django RESTQL Play Ground**](https://django-restql-playground.yezyilomo.me) is a graphical, interactive, in-browser tool which you can use to test **Django RESTQL** features like data querying, mutations etc to get the idea of how the library works before installing it. It's more like a [**live demo**](https://django-restql-playground.yezyilomo.me) for **Django RESTQL**, it's available at [https://django-restql-playground.yezyilomo.me](https://django-restql-playground.yezyilomo.me)
+
+
+## Running Tests
+`python runtests.py`
+
+
+## Credits
+* Implementation of this library is based on the idea behind [GraphQL](https://graphql.org/).
+* My intention is to extend the capability of [drf-dynamic-fields](https://github.com/dbrgn/drf-dynamic-fields) library to support more functionalities like allowing to query nested fields both flat and iterable at any level and allow writing on nested fields while maintaining simplicity.
+
+
+## Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
+
+We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/yezyilomo/django-restql/pulls) or as [GitHub issues](https://github.com/yezyilomo/django-restql/issues). If you'd like to improve code, check out the [Code Style Guide](https://github.com/yezyilomo/django-restql/blob/master/CONTRIBUTING.md#styleguides) and have a good time!.
+
+
+
+
+%prep
+%autosetup -n django-restql-0.15.3
+
+%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-django-restql -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 0.15.3-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..84319ff
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+5f166e4b101e3b8d4289993744c6855d django-restql-0.15.3.tar.gz