Opencrud Graphene Django implementation
Project description
# OpenCrud Graphene Django implementation
## Usage
```python
import graphene
from graphene_django.types import DjangoObjectType
from django.contrib.auth import models as auth_models
from graphene import Node
from opencrud.connection import WithOpenCrudConnection
from opencrud.list import OpenCrudDjangoFilterListField
from opencrud.filter import OpenCrudDjangoFilterConnectionField
from opencrud.field import OpenCrudDjangoField
class User(DjangoObjectType):
@WithOpenCrudConnection(auth_models.User)
class Meta:
filter_fields = ('id', 'email', )
interfaces = (Node, )
class Query(graphene.ObjectType):
user = OpenCrudDjangoField(User)
users = OpenCrudDjangoFilterListField(User)
users_connection = OpenCrudDjangoFilterConnectionField(User)
```
## Contributing
After cloning this repo, ensure dependencies are installed by running:
```sh
pip install -e ".[test]"
```
After developing, the full test suite can be evaluated by running:
```sh
py.test opencrud --cov=opencrud # Use -v -s for verbose mode
```
## Usage
```python
import graphene
from graphene_django.types import DjangoObjectType
from django.contrib.auth import models as auth_models
from graphene import Node
from opencrud.connection import WithOpenCrudConnection
from opencrud.list import OpenCrudDjangoFilterListField
from opencrud.filter import OpenCrudDjangoFilterConnectionField
from opencrud.field import OpenCrudDjangoField
class User(DjangoObjectType):
@WithOpenCrudConnection(auth_models.User)
class Meta:
filter_fields = ('id', 'email', )
interfaces = (Node, )
class Query(graphene.ObjectType):
user = OpenCrudDjangoField(User)
users = OpenCrudDjangoFilterListField(User)
users_connection = OpenCrudDjangoFilterConnectionField(User)
```
## Contributing
After cloning this repo, ensure dependencies are installed by running:
```sh
pip install -e ".[test]"
```
After developing, the full test suite can be evaluated by running:
```sh
py.test opencrud --cov=opencrud # Use -v -s for verbose mode
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphene-django-opencrud-1.0.0.tar.gz.
File metadata
- Download URL: graphene-django-opencrud-1.0.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afe182dc21f876e623428280bab98ac67b018d899692860d55bd1a76380e928b
|
|
| MD5 |
0bf54c3f7179b953066ca610fec47b22
|
|
| BLAKE2b-256 |
e489dc3e744377c9bf078b179816e4c77d9c113f8ad2395e5fcc032909f1c8c5
|
File details
Details for the file graphene_django_opencrud-1.0.0-py3-none-any.whl.
File metadata
- Download URL: graphene_django_opencrud-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aec74f0f0ff5e1fe3defbecf0ab1a18352d0cf52f397bbc33571b29de0924202
|
|
| MD5 |
f3d82aac549c913c300530638d4fab77
|
|
| BLAKE2b-256 |
050cac23e3cdbc9c162e76846a2f4906cb6a59ae98f671beee667644c96fe079
|