Commit 1d26b398 by Leonid Shvechikov Committed by Tom Christie

Fix comment for SerializerMethodField.bind method (#4389)

It seems that the example was copy&pasted and not updated properly.
parent ebf43346
...@@ -1656,7 +1656,7 @@ class SerializerMethodField(Field): ...@@ -1656,7 +1656,7 @@ class SerializerMethodField(Field):
def bind(self, field_name, parent): def bind(self, field_name, parent):
# In order to enforce a consistent style, we error if a redundant # In order to enforce a consistent style, we error if a redundant
# 'method_name' argument has been used. For example: # '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) default_method_name = 'get_{field_name}'.format(field_name=field_name)
assert self.method_name != default_method_name, ( assert self.method_name != default_method_name, (
"It is redundant to specify `%s` on SerializerMethodField '%s' in " "It is redundant to specify `%s` on SerializerMethodField '%s' in "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment