Skip to content

Commit

Permalink
ASerializerMethodField
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiusnick committed Oct 23, 2024
1 parent 4dfed1b commit 8e67221
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adrf/fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rest_framework.serializers import SerializerMethodField as DRFSerializerMethodField

class SerializerMethodField(DRFSerializerMethodField):
async def ato_representation(self, attribute):
method = getattr(self.parent, self.method_name)
return await method(attribute)

0 comments on commit 8e67221

Please sign in to comment.