Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Umut Bozkurt committed Jan 16, 2015
2 parents 093a7a9 + ebbf953 commit 5a1a1ce
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,24 @@ Django Rest Framework Mongoengine

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

# version 2.0
v2.0 will be released soon. Till then, you can check documentation

# DRF 3
Starting from `version 2.0`, this package will be developed using `DRF 3.0` and higher.

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

## Installation
`pip install django-rest-framework-mongoengine`

Don't forget to add the package to installed apps.
```Python
INSTALLED_APPS = (
...
'rest_framework_mongoengine',
)
```

## Documentation
See full documentation [here](https://pythonhosted.org/django-rest-framework-mongoengine/)
### DocumentSerializer
`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`.
```Python
from rest_framework_mongoengine.serializers import DocumentSerializer

class BlogSerializer(DocumentSerializer):
class Meta:
model = Blog
fields = ('id', 'author', 'name', 'date_created')
```
### DynamicDocumentSerializer
A `DocumentSerializer` for dynamic documents.
### EmbeddedDocumentSerializer
Expand All @@ -37,3 +31,21 @@ A `DocumentSerializer` for dynamic documents.
Just make sure you are using `DRFME Generics`.

`from rest_framework_mongoengine import generics`

## Installation
`pip install django-rest-framework-mongoengine`

**Note:** You might consider using a specific version.

***For clarity:***
- DRF2 support: `pip install "django-rest-framework-mongoengine<2.0"`
- DRF3 support: `pip install "django-rest-framework-mongoengine>=2.0"`


Don't forget to add the package to installed apps.
```Python
INSTALLED_APPS = (
...
'rest_framework_mongoengine',
)
```

0 comments on commit 5a1a1ce

Please sign in to comment.