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
Close
Hashes for graphene-django-opencrud-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | afe182dc21f876e623428280bab98ac67b018d899692860d55bd1a76380e928b |
|
MD5 | 0bf54c3f7179b953066ca610fec47b22 |
|
BLAKE2b-256 | e489dc3e744377c9bf078b179816e4c77d9c113f8ad2395e5fcc032909f1c8c5 |
Close
Hashes for graphene_django_opencrud-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aec74f0f0ff5e1fe3defbecf0ab1a18352d0cf52f397bbc33571b29de0924202 |
|
MD5 | f3d82aac549c913c300530638d4fab77 |
|
BLAKE2b-256 | 050cac23e3cdbc9c162e76846a2f4906cb6a59ae98f671beee667644c96fe079 |