mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
update SerializerMethodField example
This commit is contained in:
parent
0cddf097ca
commit
c334229111
|
@ -583,6 +583,7 @@ The serializer method referred to by the `method_name` argument should accept a
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
def get_days_since_joined(self, obj):
|
def get_days_since_joined(self, obj):
|
||||||
return (now() - obj.date_joined).days
|
return (now() - obj.date_joined).days
|
||||||
|
|
Loading…
Reference in New Issue
Block a user