Fix comment for SerializerMethodField.bind method (#4389)

It seems that the example was copy&pasted and not updated properly.
This commit is contained in:
Leonid Shvechikov 2016-08-12 00:15:21 +03:00 committed by Tom Christie
parent ebf43346a1
commit 1d26b398ad

View File

@ -1656,7 +1656,7 @@ class SerializerMethodField(Field):
def bind(self, field_name, parent):
# In order to enforce a consistent style, we error if a redundant
# 'method_name' argument has been used. For example:
# my_field = serializer.CharField(source='my_field')
# my_field = serializer.SerializerMethodField(method_name='get_my_field')
default_method_name = 'get_{field_name}'.format(field_name=field_name)
assert self.method_name != default_method_name, (
"It is redundant to specify `%s` on SerializerMethodField '%s' in "