Skip to content
Snippets Groups Projects
Commit 5f9431b2 authored by Rob Atkinson's avatar Rob Atkinson
Browse files

Added docs to README on controlling visibility of nested fields

parent f3fab194
No related branches found
No related tags found
1 merge request!5Added @id field and docs to README on controlling visibility of nested fields
......@@ -9,6 +9,8 @@ It aims at enabling people with little development skills to serve their own dat
* Django (known to work with django 1.11)
* Django Rest Framework
* pyld
* django-guardian
* djangorestframework-guardian
## Installation
......@@ -35,6 +37,22 @@ class Todo(models.Model):
```
Note that at this stage you can limit access to certain fields of models using
```
<Model>._meta.serializer_fields (<>list of field names to show>)
```
For example, if you have a model with a related field with type **django.contrib.auth.models.User** you don't want to show personal details or password hashes.
E.g.
```
from django.contrib.auth.models import User
User._meta.serializer_fields = ('username','first_name','last_name')
```
### 4- Add a url in your urls.py:
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment