Skip to content

Commit 8e67221

Browse files
committed
ASerializerMethodField
1 parent 4dfed1b commit 8e67221

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

adrf/fields.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from rest_framework.serializers import SerializerMethodField as DRFSerializerMethodField
2+
3+
class SerializerMethodField(DRFSerializerMethodField):
4+
async def ato_representation(self, attribute):
5+
method = getattr(self.parent, self.method_name)
6+
return await method(attribute)

0 commit comments

Comments
 (0)