mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
This commit is contained in:
commit
a18d3df0f6
2
docs/api-guide/generic-views.md
Normal file → Executable file
2
docs/api-guide/generic-views.md
Normal file → Executable file
|
@ -200,7 +200,7 @@ Should be mixed in with any [GenericAPIView].
|
||||||
|
|
||||||
Provides a `.retrieve(request, *args, **kwargs)` method, that implements returning an existing model instance in a response.
|
Provides a `.retrieve(request, *args, **kwargs)` method, that implements returning an existing model instance in a response.
|
||||||
|
|
||||||
If an object can be retrieve this returns a `200 OK` response, with a serialized representation of the object as the body of the response. Otherwise it will return a `404 Not Found`.
|
If an object can be retrieved this returns a `200 OK` response, with a serialized representation of the object as the body of the response. Otherwise it will return a `404 Not Found`.
|
||||||
|
|
||||||
Should be mixed in with [SingleObjectAPIView].
|
Should be mixed in with [SingleObjectAPIView].
|
||||||
|
|
||||||
|
|
2
docs/api-guide/serializers.md
Normal file → Executable file
2
docs/api-guide/serializers.md
Normal file → Executable file
|
@ -353,7 +353,7 @@ The `depth` option should be set to an integer value that indicates the depth of
|
||||||
|
|
||||||
## Specifying which fields should be read-only
|
## Specifying which fields should be read-only
|
||||||
|
|
||||||
You may wish to specify multiple fields as read-only. Instead of adding each field explicitely with the `read_only=True` attribute, you may use the `read_only_fields` Meta option, like so:
|
You may wish to specify multiple fields as read-only. Instead of adding each field explicitly with the `read_only=True` attribute, you may use the `read_only_fields` Meta option, like so:
|
||||||
|
|
||||||
class AccountSerializer(serializers.ModelSerializer):
|
class AccountSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -113,6 +113,7 @@ The following people have helped make REST framework great.
|
||||||
* Pierre Dulac - [dulaccc]
|
* Pierre Dulac - [dulaccc]
|
||||||
* Dave Kuhn - [kuhnza]
|
* Dave Kuhn - [kuhnza]
|
||||||
* Sitong Peng - [stoneg]
|
* Sitong Peng - [stoneg]
|
||||||
|
* Victor Shih - [vshih]
|
||||||
|
|
||||||
Many thanks to everyone who's contributed to the project.
|
Many thanks to everyone who's contributed to the project.
|
||||||
|
|
||||||
|
@ -260,3 +261,4 @@ You can also contact [@_tomchristie][twitter] directly on twitter.
|
||||||
[dulaccc]: https://github.com/dulaccc
|
[dulaccc]: https://github.com/dulaccc
|
||||||
[kuhnza]: https://github.com/kuhnza
|
[kuhnza]: https://github.com/kuhnza
|
||||||
[stoneg]: https://github.com/stoneg
|
[stoneg]: https://github.com/stoneg
|
||||||
|
[vshih]: https://github.com/vshih
|
||||||
|
|
|
@ -181,7 +181,7 @@ TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)', '"', "'"]
|
||||||
WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>'),
|
WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>'),
|
||||||
('"', '"'), ("'", "'")]
|
('"', '"'), ("'", "'")]
|
||||||
word_split_re = re.compile(r'(\s+)')
|
word_split_re = re.compile(r'(\s+)')
|
||||||
simple_url_re = re.compile(r'^https?://\w', re.IGNORECASE)
|
simple_url_re = re.compile(r'^https?://\[?\w', re.IGNORECASE)
|
||||||
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE)
|
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE)
|
||||||
simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
|
simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user