Skip to content

Commit d12de92

Browse files
committed
Remove docs for 3.0 banners
1 parent 2ddb6bf commit d12de92

File tree

7 files changed

+6
-48
lines changed

7 files changed

+6
-48
lines changed

docs/api-guide/fields.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: fields.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Serializer fields
104

115
> Each field in a Form class is responsible not only for validating data, but also for "cleaning" it — normalizing it to a consistent format.

docs/api-guide/generic-views.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
source: mixins.py
22
generics.py
33

4-
---
5-
6-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
7-
8-
---
9-
104
# Generic views
115

126
> Django’s generic views... were developed as a shortcut for common usage patterns... They take certain common idioms and patterns found in view development and abstract them so that you can quickly write common views of data without having to repeat yourself.

docs/api-guide/metadata.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: metadata.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Metadata
104

115
> [The `OPTIONS`] method allows a client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
@@ -59,7 +53,7 @@ Or you can set the metadata class individually for a view:
5953

6054
class APIRoot(APIView):
6155
metadata_class = APIRootMetadata
62-
56+
6357
def get(self, request, format=None):
6458
return Response({
6559
...

docs/api-guide/relations.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: relations.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Serializer relations
104

115
> Bad programmers worry about the code.

docs/api-guide/requests.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: request.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Requests
104

115
> If you're doing REST-based web service stuff ... you should ignore request.POST.

docs/api-guide/serializers.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: serializers.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Serializers
104

115
> Expanding the usefulness of the serializers is something that we would
@@ -23,7 +17,7 @@ The serializers in REST framework work very similarly to Django's `Form` and `Mo
2317
Let's start by creating a simple object we can use for example purposes:
2418

2519
from datetime import datetime
26-
20+
2721
class Comment(object):
2822
def __init__(self, email, content, created=None):
2923
self.email = email

docs/api-guide/validators.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
source: validators.py
22

3-
---
4-
5-
**Note**: This is the documentation for the **version 3.0** of REST framework. Documentation for [version 2.4](http://tomchristie.github.io/rest-framework-2-docs/) is also available.
6-
7-
---
8-
93
# Validators
104

115
> Validators can be useful for re-using validation logic between different types of fields.
@@ -33,7 +27,7 @@ When you're using `ModelSerializer` all of this is handled automatically for you
3327
As an example of how REST framework uses explicit validation, we'll take a simple model class that has a field with a uniqueness constraint.
3428

3529
class CustomerReportRecord(models.Model):
36-
time_raised = models.DateTimeField(default=timezone.now, editable=False)
30+
time_raised = models.DateTimeField(default=timezone.now, editable=False)
3731
reference = models.CharField(unique=True, max_length=20)
3832
description = models.TextField()
3933

@@ -43,7 +37,7 @@ Here's a basic `ModelSerializer` that we can use for creating or updating instan
4337
class Meta:
4438
model = CustomerReportRecord
4539

46-
If we open up the Django shell using `manage.py shell` we can now
40+
If we open up the Django shell using `manage.py shell` we can now
4741

4842
>>> from project.example.serializers import CustomerReportSerializer
4943
>>> serializer = CustomerReportSerializer()
@@ -204,7 +198,7 @@ A validator may be any callable that raises a `serializers.ValidationError` on f
204198

205199
def even_number(value):
206200
if value % 2 != 0:
207-
raise serializers.ValidationError('This field must be an even number.')
201+
raise serializers.ValidationError('This field must be an even number.')
208202

209203
## Class based
210204

@@ -213,7 +207,7 @@ To write a class based validator, use the `__call__` method. Class based validat
213207
class MultipleOf:
214208
def __init__(self, base):
215209
self.base = base
216-
210+
217211
def __call__(self, value):
218212
if value % self.base != 0
219213
message = 'This field must be a multiple of %d.' % self.base

0 commit comments

Comments
 (0)