diff options
| author | Carlton Gibson | 2014-11-18 16:42:39 +0100 |
|---|---|---|
| committer | Carlton Gibson | 2014-11-18 16:42:39 +0100 |
| commit | c50a42bddc66e28d624cd3caadd2d63502ac2e6e (patch) | |
| tree | bf03e2dcb23c2e4f372ff00cba4a810a96c24681 /docs/api-guide/serializers.md | |
| parent | ba52c0c62762b9976fffa72dde7ce922176e481d (diff) | |
| parent | 080bd3d24e1866df2acc3aae0ec0f97ebe3a8c36 (diff) | |
| download | django-rest-framework-c50a42bddc66e28d624cd3caadd2d63502ac2e6e.tar.bz2 | |
Merge branch 'master' of github.com:tomchristie/django-rest-framework
Diffstat (limited to 'docs/api-guide/serializers.md')
| -rw-r--r-- | docs/api-guide/serializers.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index a3694510..eeeffa13 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -413,6 +413,16 @@ Alternative representations include serializing using hyperlinks, serializing co For full details see the [serializer relations][relations] documentation. +## Inheritance of the 'Meta' class + +The inner `Meta` class on serializers is not inherited from parent classes by default. This is the same behaviour as with Django's `Model` and `ModelForm` classes. If you want the `Meta` class to inherit from a parent class you must do so explicitly. For example: + + class AccountSerializer(MyBaseSerializer): + class Meta(MyBaseSerializer.Meta): + model = Account + +Typically we would recommend *not* using inheritance on inner Meta classes, but instead declaring all options explicitly. + --- # HyperlinkedModelSerializer |
