<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import

from rest_framework import serializers
from rest_framework.reverse import reverse

from ..models.hook_log import HookLog


class HookLogSerializer(serializers.ModelSerializer):

    class Meta:
        model = HookLog
        fields = ("url", "uid", "tries", "status", "status_str", "status_code",
                  "message", "date_modified")

        read_only_fields = ("uid", "tries", "status", "status_str", "status_code", "message", "date_modified")

    url = serializers.SerializerMethodField()

    def get_url(self, hook_log):
        hook = hook_log.hook
        return reverse("hook-log-detail", args=(hook.asset.uid, hook.uid, hook_log.uid),
                       request=self.context.get("request", None))<commit_msg>Expose 'instance_id' in HookLogViewSet<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import

from rest_framework import serializers
from rest_framework.reverse import reverse

from ..models.hook_log import HookLog


class HookLogSerializer(serializers.ModelSerializer):

    class Meta:
        model = HookLog
        fields = ("url", "uid", "instance_id", "tries", "status", "status_str", "status_code",
                  "message", "date_modified")

        read_only_fields = ("uid", "instance_id", "tries", "status", "status_str", "status_code", "message", "date_modified")

    url = serializers.SerializerMethodField()

    def get_url(self, hook_log):
        hook = hook_log.hook
        return reverse("hook-log-detail", args=(hook.asset.uid, hook.uid, hook_log.uid),
                       request=self.context.get("request", None))
{'fraction_non_alphanumeric': 0.13118664281454978, 'fraction_numerical': 0.0011926058437686344, 'mean_word_length': 3.510752688172043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001181', 'n_tokens_mistral': 492, 'n_tokens_neox': 477, 'n_words': 116}