def METHOD_NAME(self, obj):
    if not obj.latest_version:
        return None
    version = obj.latest_version.version
    return {
        "version": version,
        "href": reverse(
            'api:v2:version-detail',
            kwargs={
                'namespace': obj.namespace.name,
                'name': obj.name,
                'version': version,
            },
            request=self.context.get('request'),
        )
    }