-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,14 +402,14 @@ the `.from_orm()` method on the schema object. | |
|
||
Consider the following model: | ||
|
||
``` | ||
```Python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please lowercase
|
||
class Person(models.Model): | ||
name = models.CharField(max_length=50) | ||
``` | ||
|
||
Which can be accessed using this schema: | ||
|
||
``` | ||
```Python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please lowercase
|
||
class PersonSchema(Schema): | ||
name: str | ||
``` | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please lowercase
|
||
>>> person = Person.objects.get(id=1) | ||
>>> data = PersonSchema.from_orm(person) | ||
>>> data | ||
|
@@ -432,7 +432,7 @@ PersonSchema(id=1, name='Mr. Smith') | |
|
||
Multiple Items: or a queryset (or list) | ||
|
||
``` | ||
```Python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please lowercase
|
||
>>> persons = Person.objects.all() | ||
>>> data = [PersonSchema.from_orm(i).dict() for i in persons] | ||
[{'id':1, 'name':'Mr. Smith'},{'id': 2, 'name': 'Mrs. Smith'}...] | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ofpython
. Should I keep the same format (Python
) or not?There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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?