Question: I am using a custom font and I want it to be customised using storyboard and size class. I want to vary it according to screen size of iPad and iPhone, smaller the screen size smaller the font size. But its not changing if I am using this custom font. I am using Xcode 7.

[![I am trying to do it this way](https://i.stack.imgur.com/ovCXq.png)](https://i.stack.imgur.com/ovCXq.png)

Answer: 
You can implement `get_liked` method in mixin class and use this class as parent for both serializers like this:

```
class LikesMixin:
    def get_liked(self, obj):
        request = self.context.get('request')
        self_like_obj = Reaction.objects.filter(user=request.user.id, content_type=ContentType.objects.get(model='comment'), object_id=obj.id)
        if self_like_obj.exists():
            self_like = Reaction.objects.get(user=request.user.id, content_type=ContentType.objects.get(model='comment'), object_id=obj.id).react_type
        else:
            self_like = False
        return self_like

class CommentSerializer(ModelSerializer, LikesMixin):
    liked = SerializerMethodField()
    class Meta:
        model = Comment
        fields = [
            'id',
            'self_liked',
            'content'
        ]

class ArticleDetailSerializer(ModelSerializer, LikesMixin):
    liked = SerializerMethodField()
    class Meta:
        model = Article
        fields = [
            'id',
            'self_liked',
            'title'
        ]

```
This is a good example of when to use a [mixin class](https://stackoverflow.com/a/547714/253599). The mixin is a new class which contains methods and class attributes you want to use in other classes, like this:

```
class LikedMixin(object):
    liked = SerializerMethodField()

    def get_liked(self, obj):
        request = self.context.get('request')
        self_like_obj = Reaction.objects.filter(user=request.user.id, content_type=ContentType.objects.get(model='article'), object_id=obj.id)
        if self_like_obj.exists():
            self_like = Reaction.objects.get(user=request.user.id, content_type=ContentType.objects.get(model='article'), object_id=obj.id).react_type
        else:
            self_like = False
        return self_like

```

You may then declare your serializers to inherit from your mixin:

```
class ArticleDetailSerializer(LikedMixin, ModelSerializer):
    class Meta:
        model = Article
        fields = [
            'id',
            'self_liked',
            'title'
        ]

class CommentSerializer(LikedMixin, ModelSerializer):
    class Meta:
        model = Comment
        fields = [
            'id',
            'self_liked',
            'content'
        ]

```

It might be a good idea to familiarise yourself with the basics of [method resolution order in Python](https://stackoverflow.com/a/3277407/253599), in order to recognise any potential issues relating to multiple inheritance down the track.