Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: configure syntax coloring #878

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/guides/response/django-pydantic.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ class PatchGroupSchema(ModelSchema):

also you can define just a few optional fields instead of all:

```
```Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please lowercase python?

Python -> python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. But the current file is using Python instead of python. Should I keep the same format (Python) or not?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm this is unusual. I think powercasing everything is better :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge this one and I can create another MR to harmonize everything?

model_fields_optional = ['description']
```
8 changes: 4 additions & 4 deletions docs/docs/guides/response/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@ the `.from_orm()` method on the schema object.

Consider the following model:

```
```Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please lowercase python?

Python -> python

class Person(models.Model):
name = models.CharField(max_length=50)
```

Which can be accessed using this schema:

```
```Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please lowercase python?

Python -> python

class PersonSchema(Schema):
name: str
```
Expand All @@ -419,7 +419,7 @@ schema. Once you have an instance of the schema object, the `.dict()` and
`.json()` methods allow you to get at both dictionary output and string JSON
versions.

```
```Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please lowercase python?

Python -> python

>>> person = Person.objects.get(id=1)
>>> data = PersonSchema.from_orm(person)
>>> data
Expand All @@ -432,7 +432,7 @@ PersonSchema(id=1, name='Mr. Smith')

Multiple Items: or a queryset (or list)

```
```Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please lowercase python?

Python -> python

>>> persons = Person.objects.all()
>>> data = [PersonSchema.from_orm(i).dict() for i in persons]
[{'id':1, 'name':'Mr. Smith'},{'id': 2, 'name': 'Mrs. Smith'}...]
Expand Down