mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Docs tweaks
This commit is contained in:
parent
9ade21c793
commit
b581ffe323
|
@ -30,6 +30,8 @@ A generic field that can be tied to any arbitrary model field. The `ModelField`
|
|||
|
||||
**Signature:** `ModelField(model_field=<Django ModelField class>)`
|
||||
|
||||
---
|
||||
|
||||
# Typed Fields
|
||||
|
||||
These fields represent basic datatypes, and support both reading and writing values.
|
||||
|
@ -48,6 +50,8 @@ These fields represent basic datatypes, and support both reading and writing val
|
|||
|
||||
## FloatField
|
||||
|
||||
---
|
||||
|
||||
# Relational Fields
|
||||
|
||||
Relational fields are used to represent model relationships. They can be applied to `ForeignKey`, `ManyToManyField` and `OneToOneField` relationships, as well as to reverse relationships, and custom relationships such as `GenericForeignKey`.
|
||||
|
|
|
@ -89,7 +89,7 @@ We're going to create a simple Web API that we can use to edit these comment obj
|
|||
id = serializers.IntegerField(readonly=True)
|
||||
email = serializers.EmailField()
|
||||
content = serializers.CharField(max_length=200)
|
||||
created = serializers.DateTimeField()
|
||||
created = serializers.DateTimeField(readonly=True)
|
||||
|
||||
def restore_object(self, attrs, instance=None):
|
||||
"""
|
||||
|
|
|
@ -114,7 +114,7 @@ Now update the `urls.py` file slightly, to append a set of `format_suffix_patter
|
|||
from django.conf.urls import patterns, url
|
||||
from rest_framework.urlpatterns import format_suffix_patterns
|
||||
|
||||
urlpatterns = patterns('blogpost.views',
|
||||
urlpatterns = patterns('blog.views',
|
||||
url(r'^$', 'comment_root'),
|
||||
url(r'^(?P<pk>[0-9]+)$', 'comment_instance')
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user