Skip to content

Commit 5ad41a3

Browse files
Arun S KumarArun S Kumar
authored andcommitted
� Conflicts: � examples/flask_mongoengine/app.py � graphene_mongo/converter.py � graphene_mongo/fields.py � graphene_mongo/tests/models.py � graphene_mongo/tests/nodes.py � graphene_mongo/tests/test_converter.py � graphene_mongo/tests/test_relay_query.py
2 parents 63b4f93 + 7ca0925 commit 5ad41a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2629
-1313
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _build/
66
build/
77
dist/
88
graphene_mongo.egg-info/
9+
htmlcov/
910
*.pyc
1011
*.swo
1112
*.swp

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- "3.4"
55
- "3.5"
66
- "3.6"
7+
- "3.8"
78
install:
89
pip install -r requirements.txt
910
script: make test

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018-Present Abaw Chen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
global-exclude *.py[cod]
2+
recursive-exclude examples *
3+
recursive-exclude graphene-mongo/tests *
4+
include README.md LICENSE

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ lint:
1414
@flake8 graphene_mongo
1515

1616
test: clean lint
17-
py.test --cov=graphene_mongo
17+
py.test graphene_mongo/tests --cov=graphene_mongo --cov-report=html --cov-report=term
1818

1919
register-pypitest:
2020
python setup.py register -r pypitest

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/graphql-python/graphene-mongo.svg?branch=master)](https://travis-ci.org/graphql-python/graphene-mongo) [![Coverage Status](https://coveralls.io/repos/github/graphql-python/graphene-mongo/badge.svg?branch=master)](https://coveralls.io/github/graphql-python/graphene-mongo?branch=master) [![Documentation Status](https://readthedocs.org/projects/graphene-mongo/badge/?version=latest)](http://graphene-mongo.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/graphene-mongo.svg)](https://badge.fury.io/py/graphene-mongo) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/graphene-mongo.svg)](https://pypi.python.org/pypi/graphene-mongo/)
1+
[![Build Status](https://travis-ci.org/graphql-python/graphene-mongo.svg?branch=master)](https://travis-ci.org/graphql-python/graphene-mongo) [![Coverage Status](https://coveralls.io/repos/github/graphql-python/graphene-mongo/badge.svg?branch=master)](https://coveralls.io/github/graphql-python/graphene-mongo?branch=master) [![Documentation Status](https://readthedocs.org/projects/graphene-mongo/badge/?version=latest)](http://graphene-mongo.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/graphene-mongo.svg)](https://badge.fury.io/py/graphene-mongo) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/graphene-mongo.svg)](https://pypi.python.org/pypi/graphene-mongo/) [![Downloads](https://pepy.tech/badge/graphene-mongo)](https://pepy.tech/project/graphene-mongo)
22

33
# Graphene-Mongo
44

@@ -7,7 +7,7 @@ A [Mongoengine](https://mongoengine-odm.readthedocs.io/) integration for [Graphe
77

88
## Installation
99

10-
For instaling graphene-mongo, just run this command in your shell
10+
For installing graphene-mongo, just run this command in your shell
1111

1212
```
1313
pip install graphene-mongo
@@ -65,20 +65,10 @@ result = schema.execute(query)
6565

6666
To learn more check out the following [examples](examples/):
6767

68-
* **Full example**: [Flask MongoEngine example](examples/flask_mongoengine)
68+
* [Flask MongoEngine example](examples/flask_mongoengine)
69+
* [Django MongoEngine example](examples/django_mongoengine)
70+
* [Falcon MongoEngine example](examples/falcon_mongoengine)
6971

70-
## TODOs
71-
72-
- [ ] Examples
73-
- [x] Flask example
74-
- [ ] Django example
75-
- [x] Filtering & Paging
76-
- [x] Default filtering enabled with all model's attributes by equal comparison (requester: [git-albertomarin](https://github.com/git-albertomarin))
77-
- [x] Take first, or last n items (credit: [alexpantyukhin](https://github.com/alexpantyukhin))
78-
- [x] Filter by global id (requester: [bwalsh](https://github.com/bwalsh))
79-
- [x] Filter by reference model id (requester: [msholty-fd](https://github.com/msholty-fd))
80-
- [ ] Support more types ([Currently supported](http://graphene-mongo.readthedocs.io/en/latest/fields.html#))
81-
- [x] Self-reference and list-of-self-reference relationship (requester: [mehdiym](https://github.com/mehdiym))
8272

8373
## Contributing
8474

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A `Mongoengine <https://mongoengine-odm.readthedocs.io/>`__ integration for `Gra
1515
Installation
1616
------------
1717

18-
For instaling graphene-mongo, just run this command in your shell
18+
For installing graphene-mongo, just run this command in your shell
1919

2020
.. code:: bash
2121

docs/conf.py

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
3+
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
44

55
# -*- coding: utf-8 -*-
66
#
@@ -34,46 +34,44 @@
3434
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3535
# ones.
3636
extensions = [
37-
'sphinx.ext.autodoc',
38-
'sphinx.ext.intersphinx',
39-
'sphinx.ext.todo',
40-
'sphinx.ext.coverage',
41-
'sphinx.ext.viewcode',
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.intersphinx",
39+
"sphinx.ext.todo",
40+
"sphinx.ext.coverage",
41+
"sphinx.ext.viewcode",
4242
]
4343
if not on_rtd:
44-
extensions += [
45-
'sphinx.ext.githubpages',
46-
]
44+
extensions += ["sphinx.ext.githubpages"]
4745

4846
# Add any paths that contain templates here, relative to this directory.
49-
templates_path = ['_templates']
47+
templates_path = ["_templates"]
5048

5149
# The suffix(es) of source filenames.
5250
# You can specify multiple suffix as a list of string:
5351
#
5452
# source_suffix = ['.rst', '.md']
55-
source_suffix = '.rst'
53+
source_suffix = ".rst"
5654

5755
# The encoding of source files.
5856
#
5957
# source_encoding = 'utf-8-sig'
6058

6159
# The master toctree document.
62-
master_doc = 'index'
60+
master_doc = "index"
6361

6462
# General information about the project.
65-
project = u'Graphene Mongo'
66-
copyright = u'Graphene 2018'
67-
author = u'Abaw Chen'
63+
project = u"Graphene Mongo"
64+
copyright = u"Graphene 2018"
65+
author = u"Abaw Chen"
6866

6967
# The version info for the project you're documenting, acts as replacement for
7068
# |version| and |release|, also used in various other places throughout the
7169
# built documents.
7270
#
7371
# The short X.Y version.
74-
version = u'0.1'
72+
version = u"0.1"
7573
# The full version, including alpha/beta/rc tags.
76-
release = u'0.1.2'
74+
release = u"0.1.2"
7775

7876
# The language for content autogenerated by Sphinx. Refer to documentation
7977
# for a list of supported languages.
@@ -94,7 +92,7 @@
9492
# List of patterns, relative to source directory, that match files and
9593
# directories to ignore when looking for source files.
9694
# This patterns also effect to html_static_path and html_extra_path
97-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
95+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
9896

9997
# The reST default role (used for this markup: `text`) to use for all
10098
# documents.
@@ -116,7 +114,7 @@
116114
# show_authors = False
117115

118116
# The name of the Pygments (syntax highlighting) style to use.
119-
pygments_style = 'sphinx'
117+
pygments_style = "sphinx"
120118

121119
# A list of ignored prefixes for module index sorting.
122120
# modindex_common_prefix = []
@@ -175,7 +173,7 @@
175173
# Add any paths that contain custom static files (such as style sheets) here,
176174
# relative to this directory. They are copied after the builtin static files,
177175
# so a file named "default.css" will overwrite the builtin "default.css".
178-
html_static_path = ['_static']
176+
html_static_path = ["_static"]
179177

180178
# Add any extra paths that contain custom files (such as robots.txt or
181179
# .htaccess) here, relative to this directory. These files are copied
@@ -255,34 +253,30 @@
255253
# html_search_scorer = 'scorer.js'
256254

257255
# Output file base name for HTML help builder.
258-
htmlhelp_basename = 'Graphenedoc'
256+
htmlhelp_basename = "Graphenedoc"
259257

260258
# -- Options for LaTeX output ---------------------------------------------
261259

262260
latex_elements = {
263-
# The paper size ('letterpaper' or 'a4paper').
264-
#
265-
# 'papersize': 'letterpaper',
266-
267-
# The font size ('10pt', '11pt' or '12pt').
268-
#
269-
# 'pointsize': '10pt',
270-
271-
# Additional stuff for the LaTeX preamble.
272-
#
273-
# 'preamble': '',
274-
275-
# Latex figure (float) alignment
276-
#
277-
# 'figure_align': 'htbp',
261+
# The paper size ('letterpaper' or 'a4paper').
262+
#
263+
# 'papersize': 'letterpaper',
264+
# The font size ('10pt', '11pt' or '12pt').
265+
#
266+
# 'pointsize': '10pt',
267+
# Additional stuff for the LaTeX preamble.
268+
#
269+
# 'preamble': '',
270+
# Latex figure (float) alignment
271+
#
272+
# 'figure_align': 'htbp',
278273
}
279274

280275
# Grouping the document tree into LaTeX files. List of tuples
281276
# (source start file, target name, title,
282277
# author, documentclass [howto, manual, or own class]).
283278
latex_documents = [
284-
(master_doc, 'Graphene.tex', u'Graphene Documentation',
285-
u'Syrus Akbary', 'manual'),
279+
(master_doc, "Graphene.tex", u"Graphene Documentation", u"Syrus Akbary", "manual")
286280
]
287281

288282
# The name of an image file (relative to this directory) to place at the top of
@@ -323,8 +317,7 @@
323317
# One entry per manual page. List of tuples
324318
# (source start file, name, description, authors, manual section).
325319
man_pages = [
326-
(master_doc, 'graphene_django', u'Graphene Django Documentation',
327-
[author], 1)
320+
(master_doc, "graphene_django", u"Graphene Django Documentation", [author], 1)
328321
]
329322

330323
# If true, show URL addresses after external links.
@@ -338,9 +331,15 @@
338331
# (source start file, target name, title, author,
339332
# dir menu entry, description, category)
340333
texinfo_documents = [
341-
(master_doc, 'Graphene-Django', u'Graphene Django Documentation',
342-
author, 'Graphene Django', 'One line description of project.',
343-
'Miscellaneous'),
334+
(
335+
master_doc,
336+
"Graphene-Django",
337+
u"Graphene Django Documentation",
338+
author,
339+
"Graphene Django",
340+
"One line description of project.",
341+
"Miscellaneous",
342+
)
344343
]
345344

346345
# Documents to append as an appendix to all manuals.
@@ -414,7 +413,7 @@
414413
# epub_post_files = []
415414

416415
# A list of files that should not be packed into the epub file.
417-
epub_exclude_files = ['search.html']
416+
epub_exclude_files = ["search.html"]
418417

419418
# The depth of the table of contents in toc.ncx.
420419
#
@@ -446,5 +445,4 @@
446445

447446

448447
# Example configuration for intersphinx: refer to the Python standard library.
449-
intersphinx_mapping = {'https://docs.python.org/': None}
450-
448+
intersphinx_mapping = {"https://docs.python.org/": None}

docs/fields.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ Mongoengine Fields
1111
- EmailField
1212
- EmbeddedDocumentField
1313
- EmbeddedDocumentListField
14+
- FileField
1415
- FloatField
15-
- IntegerField
16+
- GenericReferenceField
17+
- IntField
18+
- LazyReferenceField
1619
- ListField
20+
- LongField
21+
- MapField
22+
- MultiPolygonField
1723
- ObjectIdField
1824
- ReferenceField
25+
- PointField
26+
- PolygonField
27+
- SequenceField
1928
- StringField
2029
- URLField
2130
- UUIDField

docs/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Let's get start with following models:
6464
Schema
6565
------
6666

67-
Here I assume you guys have the basic knowledage of how schema works in GraphQL, that I define the *root type* as the `Query` class below with the ability to list all employees.
67+
Here I assume you guys have the basic knowledge of how schema works in GraphQL, that I define the *root type* as the `Query` class below with the ability to list all employees.
6868

6969
.. code:: python
7070

0 commit comments

Comments
 (0)