-
-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
215 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
.. _examples_simple: | ||
|
||
=============== | ||
Simple Examples | ||
=============== | ||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_basic: | ||
|
||
Basic | ||
===== | ||
.. literalinclude:: ../../examples/basic.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_basic_comments: | ||
|
||
Comments | ||
======== | ||
.. literalinclude:: ../../examples/basic_comments.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_prefetching: | ||
|
||
Prefetching | ||
=========== | ||
.. literalinclude:: ../../examples/complex_prefetching.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_transactions: | ||
|
||
Transactions | ||
============ | ||
.. literalinclude:: ../../examples/transactions.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_aggregation: | ||
|
||
Aggregation | ||
=========== | ||
.. literalinclude:: ../../examples/aggregation.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_schema_create: | ||
|
||
Schema creation | ||
=============== | ||
.. literalinclude:: ../../examples/schema_create.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_two_databases: | ||
|
||
Two Databases | ||
============= | ||
.. literalinclude:: ../../examples/two_databases.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_filtering: | ||
|
||
Filtering | ||
========= | ||
.. literalinclude:: ../../examples/complex_filtering.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_relations: | ||
|
||
Relations | ||
========= | ||
.. literalinclude:: ../../examples/relations.py | ||
|
||
|
||
.. rst-class:: html-toggle | ||
|
||
.. _example_relations_recursive: | ||
|
||
Recursive Relations | ||
=================== | ||
.. literalinclude:: ../../examples/relations_recursive.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.. _example_quart: | ||
|
||
============= | ||
Quart Example | ||
============= | ||
|
||
This is an example of the :ref:`contrib_quart` | ||
|
||
**Usage:** | ||
|
||
.. code-block:: sh | ||
QUART_APP=main quart | ||
... | ||
Commands: | ||
generate-schemas Populate DB with Tortoise-ORM schemas. | ||
run Start and run a development server. | ||
shell Open a shell within the app context. | ||
# To generate schemas | ||
QUART_APP=main quart generate-schemas | ||
# To run | ||
QUART_APP=main quart run | ||
models.py | ||
========= | ||
.. literalinclude:: ../../examples/quart/models.py | ||
|
||
main.py | ||
======= | ||
.. literalinclude:: ../../examples/quart/main.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. _example_sanic: | ||
|
||
============= | ||
Sanic Example | ||
============= | ||
|
||
This is an example of the :ref:`contrib_sanic` | ||
|
||
**Usage:** | ||
|
||
.. code-block:: sh | ||
python3 main.py | ||
models.py | ||
========= | ||
.. literalinclude:: ../../examples/sanic/models.py | ||
|
||
main.py | ||
======= | ||
.. literalinclude:: ../../examples/sanic/main.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. _example_starlette: | ||
|
||
================= | ||
Starlette Example | ||
================= | ||
|
||
This is an example of the :ref:`contrib_starlette` | ||
|
||
**Usage:** | ||
|
||
.. code-block:: sh | ||
python3 main.py | ||
models.py | ||
========= | ||
.. literalinclude:: ../../examples/starlette/models.py | ||
|
||
main.py | ||
======= | ||
.. literalinclude:: ../../examples/starlette/main.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,4 @@ sanic | |
|
||
# Sample integration - Starlette | ||
starlette | ||
uvicorn < 0.9 |
Oops, something went wrong.