From a9b56306027314c921fc01c3b99fb4d61620a9fd Mon Sep 17 00:00:00 2001 From: Dmitry Alimov Date: Sun, 21 Apr 2019 17:38:50 +0300 Subject: [PATCH] Fix private attributes ignore in documentation --- docs/api-guide/serializers.md | 2 +- docs/community/3.0-announcement.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index e77e78c15..8c17adbaf 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -965,7 +965,7 @@ The following class is an example of a generic serializer that can handle coerci def to_representation(self, obj): for attribute_name in dir(obj): attribute = getattr(obj, attribute_name) - if attribute_name('_'): + if attribute_name.startswith('_'): # Ignore private attributes. pass elif hasattr(attribute, '__call__'): diff --git a/docs/community/3.0-announcement.md b/docs/community/3.0-announcement.md index dc118d70c..7a29b5554 100644 --- a/docs/community/3.0-announcement.md +++ b/docs/community/3.0-announcement.md @@ -523,7 +523,7 @@ The following class is an example of a generic serializer that can handle coerci def to_representation(self, obj): for attribute_name in dir(obj): attribute = getattr(obj, attribute_name) - if attribute_name('_'): + if attribute_name.startswith('_'): # Ignore private attributes. pass elif hasattr(attribute, '__call__'):