# DRF
from rest_framework.generics import get_object_or_404

# Models
from {{project_slug}}.users.models import User






class UserParam:
    requires_context = True

    def __call__(self, serializer_field):
        return get_object_or_404(
            User, username=serializer_field.context["users_username"]
        )

    def __repr__(self):
        return "%s()" % self.__class__.__name__

