Skip to content

Commit 5a1a1ce

Browse files
author
Umut Bozkurt
committed
2 parents 093a7a9 + ebbf953 commit 5a1a1ce

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

README.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,24 @@ Django Rest Framework Mongoengine
33

44
***Mongoengine*** support for ***Django Rest Framework***.
55

6-
# version 2.0
7-
v2.0 will be released soon. Till then, you can check documentation
8-
96
# DRF 3
107
Starting from `version 2.0`, this package will be developed using `DRF 3.0` and higher.
118

129
# DRF 2
1310
If you want to use `DRFME` with `DRF 2`, you should `version 1.*`. Development will be continued on `drf_2_support` branch.
1411

15-
## Installation
16-
`pip install django-rest-framework-mongoengine`
17-
18-
Don't forget to add the package to installed apps.
19-
```Python
20-
INSTALLED_APPS = (
21-
...
22-
'rest_framework_mongoengine',
23-
)
24-
```
25-
2612
## Documentation
2713
See full documentation [here](https://pythonhosted.org/django-rest-framework-mongoengine/)
2814
### DocumentSerializer
2915
`DocumentSerializer` works just like as `DRF Model Serializer`. Your model fields are converted to relevant serializer fields automatically. If you want custom behavior, you can use `nested serializers`.
16+
```Python
17+
from rest_framework_mongoengine.serializers import DocumentSerializer
18+
19+
class BlogSerializer(DocumentSerializer):
20+
class Meta:
21+
model = Blog
22+
fields = ('id', 'author', 'name', 'date_created')
23+
```
3024
### DynamicDocumentSerializer
3125
A `DocumentSerializer` for dynamic documents.
3226
### EmbeddedDocumentSerializer
@@ -37,3 +31,21 @@ A `DocumentSerializer` for dynamic documents.
3731
Just make sure you are using `DRFME Generics`.
3832

3933
`from rest_framework_mongoengine import generics`
34+
35+
## Installation
36+
`pip install django-rest-framework-mongoengine`
37+
38+
**Note:** You might consider using a specific version.
39+
40+
***For clarity:***
41+
- DRF2 support: `pip install "django-rest-framework-mongoengine<2.0"`
42+
- DRF3 support: `pip install "django-rest-framework-mongoengine>=2.0"`
43+
44+
45+
Don't forget to add the package to installed apps.
46+
```Python
47+
INSTALLED_APPS = (
48+
...
49+
'rest_framework_mongoengine',
50+
)
51+
```

0 commit comments

Comments
 (0)