aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTom Christie2012-10-28 20:21:45 +0000
committerTom Christie2012-10-28 20:21:45 +0000
commit6e4ab09aae8295e4ef722d59894bc2934435ae46 (patch)
treeb4005e865aa2d2d125c2d9be2ea07bffd1e9df87 /docs
parent795f6116639ad5a9290db46b7f7fcbe4b0f86af2 (diff)
downloaddjango-rest-framework-6e4ab09aae8295e4ef722d59894bc2934435ae46.tar.bz2
readonly -> read_only
Diffstat (limited to 'docs')
-rw-r--r--docs/api-guide/fields.md10
-rw-r--r--docs/api-guide/serializers.md4
2 files changed, 7 insertions, 7 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md
index bf80945d..8c3df067 100644
--- a/docs/api-guide/fields.md
+++ b/docs/api-guide/fields.md
@@ -26,7 +26,7 @@ The value `source='*'` has a special meaning, and is used to indicate that the e
Defaults to the name of the field.
-### `readonly`
+### `read_only`
Set this to `True` to ensure that the field is used when serializing a representation, but is not used when updating an instance dureing deserialization.
@@ -241,7 +241,7 @@ This field can be applied to any "to-one" relationship, such as a `ForeignKey` f
`PrimaryKeyRelatedField` will represent the target of the field using it's primary key.
-Be default, `PrimaryKeyRelatedField` is read-write, although you can change this behaviour using the `readonly` flag.
+Be default, `PrimaryKeyRelatedField` is read-write, although you can change this behaviour using the `read_only` flag.
## ManyPrimaryKeyRelatedField
@@ -249,7 +249,7 @@ This field can be applied to any "to-many" relationship, such as a `ManyToManyFi
`PrimaryKeyRelatedField` will represent the targets of the field using their primary key.
-Be default, `ManyPrimaryKeyRelatedField` is read-write, although you can change this behaviour using the `readonly` flag.
+Be default, `ManyPrimaryKeyRelatedField` is read-write, although you can change this behaviour using the `read_only` flag.
## HyperlinkedRelatedField
@@ -257,7 +257,7 @@ This field can be applied to any "to-one" relationship, such as a `ForeignKey` f
`HyperlinkedRelatedField` will represent the target of the field using a hyperlink. You must include a named URL pattern in your URL conf, with a name like `'{model-name}-detail'` that corresponds to the target of the hyperlink.
-Be default, `HyperlinkedRelatedField` is read-write, although you can change this behaviour using the `readonly` flag.
+Be default, `HyperlinkedRelatedField` is read-write, although you can change this behaviour using the `read_only` flag.
## ManyHyperlinkedRelatedField
@@ -265,7 +265,7 @@ This field can be applied to any "to-many" relationship, such as a `ManyToManyFi
`ManyHyperlinkedRelatedField` will represent the targets of the field using hyperlinks. You must include a named URL pattern in your URL conf, with a name like `'{model-name}-detail'` that corresponds to the target of the hyperlink.
-Be default, `ManyHyperlinkedRelatedField` is read-write, although you can change this behaviour using the `readonly` flag.
+Be default, `ManyHyperlinkedRelatedField` is read-write, although you can change this behaviour using the `read_only` flag.
## HyperLinkedIdentityField
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 057827d3..2338b879 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -190,7 +190,7 @@ The `ModelSerializer` class lets you automatically create a Serializer class wit
You can add extra fields to a `ModelSerializer` or override the default fields by declaring fields on the class, just as you would for a `Serializer` class.
class AccountSerializer(serializers.ModelSerializer):
- url = CharField(source='get_absolute_url', readonly=True)
+ url = CharField(source='get_absolute_url', read_only=True)
group = NaturalKeyField()
class Meta:
@@ -246,7 +246,7 @@ When serializing objects using a nested representation any occurances of recursi
model = Account
def get_pk_field(self, model_field):
- return serializers.Field(readonly=True)
+ return serializers.Field(read_only=True)
def get_nested_field(self, model_field):
return serializers.ModelSerializer()