Skip to content

Commit 5d34961

Browse files
authored
Merge pull request #334 from yezyilomo/update-docs
Update docs
2 parents 985852a + 8ffecb0 commit 5d34961

File tree

4 files changed

+39
-29
lines changed

4 files changed

+39
-29
lines changed

docs/extra.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
.md-header{
1+
.md-header {
22
height: 53px;
33
padding-top: 2px;
44
}
55

6-
.md-search__form input{
7-
border-radius: 3px;
6+
.md-search__form,
7+
.md-search__output {
8+
border-radius: 8px !important;
89
}
910

10-
.md-source__icon svg{
11+
.md-search__output {
12+
margin-top: 3px !important;
13+
}
14+
15+
.md-source__icon svg {
1116
display: none;
1217
}
1318

14-
.md-source__icon{
19+
.md-source__icon {
1520
background-image: url("img/github.svg");
1621
background-repeat: no-repeat;
1722
background-position: 50% center;
1823
background-size: 22px;
24+
}
25+
26+
.md-code__content, .note{
27+
border-radius: 10px !important;
1928
}

docs/mutating_data.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Just to clarify what happed here:
8787

8888
!!! note
8989
POST for many related fields supports two operations which are `create` and `add`.
90-
<br>
9190

9291
Below we have an example where we are trying to update the property we have created in the previous example.
9392

@@ -444,7 +443,6 @@ Request Body
444443
```
445444

446445
This will remove all books associated with a course being updated.
447-
<br>
448446

449447

450448
### delete_on_null kwarg

docs/querying_data.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ If you want to retrieve user's `id`, `username` and `location` fields but under
113113
...
114114
]
115115
```
116-
<br/>
116+
117+
117118

118119
`GET /users/?query={id, username, groups{name}}`
119120
```js
@@ -389,7 +390,6 @@ class CourseSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
389390
}
390391
]
391392
```
392-
<br/>
393393

394394
`GET /course/?query={name, related_books{title}}`
395395
```js
@@ -403,7 +403,7 @@ class CourseSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
403403
}
404404
]
405405
```
406-
<br/>
406+
407407

408408
## DynamicFieldsMixin kwargs
409409
`DynamicFieldsMixin` accepts extra kwargs in addition to those accepted by a serializer, these extra kwargs can be used to do more customizations on a serializer as explained below.
@@ -494,19 +494,18 @@ From the response above you can see that `author` field has been excluded fom bo
494494
!!! note
495495
`fields` and `exclude` kwargs have no effect when you access the resources directly, so when you access books you will still get all fields i.e
496496

497-
`GET /books/`
498-
```js
499-
[
500-
{
501-
"id": 1,
502-
"title": "Computer Programming Basics",
503-
"author": "S.Mobit"
504-
},
505-
...
506-
]
507-
```
508-
So you can see that all fields have appeared as specified on `fields = ['id', 'title', 'author']` on BookSerializer class.
509-
<br/>
497+
`GET /books/`
498+
```js
499+
[
500+
{
501+
"id": 1,
502+
"title": "Computer Programming Basics",
503+
"author": "S.Mobit"
504+
},
505+
...
506+
]
507+
```
508+
Yo you can see that all fields have appeared as specified on `fields = ['id', 'title', 'author']` on BookSerializer class.
510509

511510

512511
### query kwarg
@@ -645,7 +644,6 @@ class CourseSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
645644
]
646645
```
647646
So you can see that on a nested field `books` pks have been returned instead of books data as specified on `return_pk=True` kwarg on `BookSerializer`.
648-
<br/>
649647

650648

651649
### disable_dynamic_fields kwarg
@@ -686,7 +684,6 @@ class CourseSerializer(DynamicFieldsMixin, serializers.ModelSerializer):
686684
]
687685
```
688686
So you can see that even though the query asked for only `title` field under `books`, all fields have been returned, so this means fields filtering has applied on `CourseSerializer` but not on `BookSerializer` because we used `disable_dynamic_fields=True` on it.
689-
<br/>
690687

691688

692689
## Query arguments

mkdocs.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ site_name: Django RESTQL
33
theme:
44
name: "material"
55
language: en
6-
feature:
7-
tabs: false
6+
features:
7+
- content.code.copy
88
palette:
99
primary: teal
1010
accent: teal
@@ -19,12 +19,18 @@ repo_url: https://github.com/yezyilomo/django-restql/
1919

2020
# Extensions
2121
markdown_extensions:
22+
- pymdownx.highlight:
23+
anchor_linenums: true
24+
line_spans: __span
25+
pygments_lang_class: true
26+
- pymdownx.inlinehilite
27+
- pymdownx.snippets
28+
- pymdownx.superfences
2229
- admonition
23-
- codehilite:
24-
guess_lang: false
2530
- toc:
2631
permalink: true
2732

33+
2834
nav:
2935
- Intro: index.md
3036
- Querying Data: querying_data.md

0 commit comments

Comments
 (0)