aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlton Gibson2014-04-09 15:52:26 +0200
committerCarlton Gibson2014-04-09 15:52:26 +0200
commit645ef9895f8112c3042e26fc6aa49735237f3769 (patch)
treeaae8d237b1a68e6e2ffb1b9a865bc09e87e26be3
parentc1ac65edce1bcfff4c87df3bb9c4df14fe8e9d6c (diff)
parentb0ba8d61ecf3c74470fa6ac019caff1fd4ca1be6 (diff)
downloaddjango-rest-framework-645ef9895f8112c3042e26fc6aa49735237f3769.tar.bz2
Merge branch 'refs/heads/master' into #1408
-rw-r--r--docs/api-guide/filtering.md6
-rw-r--r--rest_framework/fields.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md
index d6c4b1c1..6a8a267b 100644
--- a/docs/api-guide/filtering.md
+++ b/docs/api-guide/filtering.md
@@ -24,7 +24,7 @@ For example:
from myapp.serializers import PurchaseSerializer
from rest_framework import generics
- class PurchaseList(generics.ListAPIView)
+ class PurchaseList(generics.ListAPIView):
serializer_class = PurchaseSerializer
def get_queryset(self):
@@ -46,7 +46,7 @@ For example if your URL config contained an entry like this:
You could then write a view that returned a purchase queryset filtered by the username portion of the URL:
- class PurchaseList(generics.ListAPIView)
+ class PurchaseList(generics.ListAPIView):
serializer_class = PurchaseSerializer
def get_queryset(self):
@@ -63,7 +63,7 @@ A final example of filtering the initial queryset would be to determine the init
We can override `.get_queryset()` to deal with URLs such as `http://example.com/api/purchases?username=denvercoder9`, and filter the queryset only if the `username` parameter is included in the URL:
- class PurchaseList(generics.ListAPIView)
+ class PurchaseList(generics.ListAPIView):
serializer_class = PurchaseSerializer
def get_queryset(self):
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 68b95682..946a5954 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -164,7 +164,7 @@ class Field(object):
Called to set up a field prior to field_to_native or field_from_native.
parent - The parent serializer.
- model_field - The model field this field corresponds to, if one exists.
+ field_name - The name of the field being initialized.
"""
self.parent = parent
self.root = parent.root or parent