Skip to content

Commit 4933622

Browse files
CosmoVmahenzon
authored andcommitted
updated tortoise_orm signature and doc
1 parent 17c1824 commit 4933622

76 files changed

Lines changed: 284 additions & 277 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ if __name__ == "__main__":
195195

196196
This example provides the following API structure:
197197

198-
| URL | method | endpoint | Usage |
199-
|------------------|--------|---------------|---------------------------|
200-
| `/user` | GET | user_list | Get a collection of users |
201-
| `/user` | POST | user_list | Create a user |
202-
| `/user` | DELETE | user_list | Delete users |
203-
| `/user/{obj_id}` | GET | user_detail | Get user details |
204-
| `/user/{obj_id}` | PATCH | person_detail | Update a user |
205-
| `/user/{obj_id}` | DELETE | person_detail | Delete a user |
198+
| URL | method | endpoint | Usage |
199+
|------------------|--------|-------------|---------------------------|
200+
| `/user` | GET | user_list | Get a collection of users |
201+
| `/user` | POST | user_list | Create a user |
202+
| `/user` | DELETE | user_list | Delete users |
203+
| `/user/{obj_id}` | GET | user_detail | Get user details |
204+
| `/user/{obj_id}` | PATCH | user_detail | Update a user |
205+
| `/user/{obj_id}` | DELETE | user_detail | Delete a user |

docs/api_filtering_example.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Filtering API example
55
:language: python
66

77

8-
Check existing persons
8+
Check existing users
99

1010
Request:
1111

12-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons
12+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users
1313
:language: HTTP
1414

1515
Response:
1616

17-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons_result
17+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users_result
1818
:language: HTTP
1919

2020

@@ -33,12 +33,12 @@ Filter by word
3333
3434
Request:
3535

36-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_word_in_array
36+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_word_in_array
3737
:language: HTTP
3838

3939
Response:
4040

41-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_word_in_array_result
41+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_word_in_array_result
4242
:language: HTTP
4343

4444

@@ -56,12 +56,12 @@ Filter by words
5656
5757
Request:
5858

59-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_words_in_array
59+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_words_in_array
6060
:language: HTTP
6161

6262
Response:
6363

64-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_words_in_array_result
64+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_words_in_array_result
6565
:language: HTTP
6666

6767

@@ -79,10 +79,10 @@ Filter by any word containing value
7979
8080
Request:
8181

82-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_word_contains_in_array
82+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_word_contains_in_array
8383
:language: HTTP
8484

8585
Response:
8686

87-
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_persons__filter_word_contains_in_array_result
87+
.. literalinclude:: ./http_snippets/snippets/api_filtering__get_users__filter_word_contains_in_array_result
8888
:language: HTTP

docs/client_generated_id.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ it to the server. Let's define the id type as a UUID.
1111

1212
Request:
1313

14-
.. literalinclude:: ./http_snippets/snippets/client_generated_id__create_person
14+
.. literalinclude:: ./http_snippets/snippets/client_generated_id__create_user
1515
:language: http
1616

1717
Response:
1818

19-
.. literalinclude:: ./http_snippets/snippets/client_generated_id__create_person_result
19+
.. literalinclude:: ./http_snippets/snippets/client_generated_id__create_user_result
2020
:language: http
2121

2222

docs/errors.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ Example:
8888
8989
Request:
9090

91-
.. literalinclude:: ./http_snippets/snippets/errors__create_person
91+
.. literalinclude:: ./http_snippets/snippets/errors__create_user
9292
:language: http
9393

9494
Response:
9595

96-
.. literalinclude:: ./http_snippets/snippets/errors__create_person_result
96+
.. literalinclude:: ./http_snippets/snippets/errors__create_user_result
9797
:language: http

docs/filtering.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ So this is a first example:
2727
GET /user?filter=[{"name":"first_name","op":"eq","val":"John"}] HTTP/1.1
2828
Accept: application/vnd.api+json
2929

30-
In this example we want to retrieve person records for people named John. So we can see that the filtering interface completely fits that of SQLAlchemy: a list a filter information.
30+
In this example we want to retrieve user records for people named John. So we can see that the filtering interface completely fits that of SQLAlchemy: a list a filter information.
3131

3232
:name: the name of the field you want to filter on
3333
:op: the operation you want to use (all SQLAlchemy operations are available)

docs/http_snippets/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ httpsnippet example.json --target node --client unirest --output ./snippets
4848

4949
```shell
5050
# minimal api to python3
51-
httpsnippet minimal_api__create_person.json --target python --client python3 --output ./snippets
51+
httpsnippet minimal_api__create_user.json --target python --client python3 --output ./snippets
5252
```
5353

5454
```shell
5555
# minimal api to http
56-
httpsnippet minimal_api__create_person.json --target http --output ./snippets
56+
httpsnippet minimal_api__create_user.json --target http --output ./snippets
5757
```
5858

5959

6060
```shell
6161
# minimal api to http. don't write Host, Content-Length
62-
httpsnippet minimal_api__create_person.json --target http --output ./snippets -x '{"autoHost": false, "autoContentLength": false}'
62+
httpsnippet minimal_api__create_user.json --target http --output ./snippets -x '{"autoHost": false, "autoContentLength": false}'
6363
```
6464

6565

docs/http_snippets/api_filtering__get_persons__filter_word_contains_in_array.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/http_snippets/api_filtering__get_persons.json renamed to docs/http_snippets/api_filtering__get_users.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"method": "GET",
3-
"url": "http://localhost:5000/persons",
3+
"url": "http://localhost:5000/users",
44
"httpVersion": "HTTP/1.1",
55
"queryString": [
66
],

docs/http_snippets/api_filtering__get_persons__filter_words_in_array.json renamed to docs/http_snippets/api_filtering__get_users__filter_word_contains_in_array.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"method": "GET",
3-
"url": "http://localhost:5000/persons?filter=[{\"name\":\"words\",\"op\":\"in\",\"val\":[\"bar\",\"eggs\"]}]",
3+
"url": "http://localhost:5000/users?filter=[{\"name\":\"words\",\"op\":\"ilike_in_str_array\",\"val\":\"green\"}]",
44
"httpVersion": "HTTP/1.1",
55
"queryString": [
66
],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"method": "GET",
3+
"url": "http://localhost:5000/users?filter=[{\"name\":\"words\",\"op\":\"in\",\"val\":\"spam\"}]",
4+
"httpVersion": "HTTP/1.1",
5+
"queryString": [
6+
],
7+
"headers": [
8+
{
9+
"name": "content-type",
10+
"value": "application/vnd.api+json"
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)