compat.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:django-rest-messaging 作者: raphaelgyory 项目源码 文件源码
def compat_serializer_method_field(method_name=None):
    """ method_name changed in DRF > 3. See http://www.django-rest-framework.org/topics/3.0-announcement/#optional-argument-to-serializermethodfield. """
    if DRFVLIST[0] >= 3:
        return serializers.SerializerMethodField()
    else:
        return serializers.SerializerMethodField(method_name=method_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号