You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Mongoengine*** support for ***Django Rest Framework***.
5
5
6
-
# version 2.0
7
-
v2.0 will be released soon. Till then, you can check documentation
8
-
9
6
# DRF 3
10
7
Starting from `version 2.0`, this package will be developed using `DRF 3.0` and higher.
11
8
12
9
# DRF 2
13
10
If you want to use `DRFME` with `DRF 2`, you should `version 1.*`. Development will be continued on `drf_2_support` branch.
14
11
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
-
26
12
## Documentation
27
13
See full documentation [here](https://pythonhosted.org/django-rest-framework-mongoengine/)
28
14
### DocumentSerializer
29
15
`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
+
classBlogSerializer(DocumentSerializer):
20
+
classMeta:
21
+
model = Blog
22
+
fields = ('id', 'author', 'name', 'date_created')
23
+
```
30
24
### DynamicDocumentSerializer
31
25
A `DocumentSerializer` for dynamic documents.
32
26
### EmbeddedDocumentSerializer
@@ -37,3 +31,21 @@ A `DocumentSerializer` for dynamic documents.
37
31
Just make sure you are using `DRFME Generics`.
38
32
39
33
`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.
0 commit comments