Placing business logic in serializers

60 views
Skip to first unread message

Lu Ali

unread,
May 15, 2013, 10:28:50 PM5/15/13
to django-res...@googlegroups.com
Hello,

just started using this framework and I have a requirement, whereby some logic is required in the serializer to check whether an update can proceed or not.

My view is 
===========================================
class UserUpdate(generics.UpdateAPIView):

    permission_classes = (UserUpdatePermission,)
    serializer_class = UserSerializer


Serializer
===========================================
class UserUpdateSerializer(serializers.ModelSerializer):

    class Meta:
        model = User

    # some function here that checks if can be updated or not.
     def ..


what function to override?
Thanks
Lu
Reply all
Reply to author
Forward
0 new messages