update SerializerMethodField example

This commit is contained in:
Joe Michelini 2021-03-21 15:32:10 -04:00
parent 0cddf097ca
commit c334229111

View File

@ -583,6 +583,7 @@ The serializer method referred to by the `method_name` argument should accept a
class Meta:
model = User
fields = '__all__'
def get_days_since_joined(self, obj):
return (now() - obj.date_joined).days