<commit_before>from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse

from rest_framework import serializers

from .models import Job


class JobsSerializer(serializers.ModelSerializer):

    href = serializers.SerializerMethodField()

    class Meta:
        model = Job
        fields = ('id', 'phase', 'href')

    def get_href(self, obj):
        current_site = Site.objects.get_current()

        href = current_site.domain + reverse('uws:job-detail', args=[obj.id])

        if settings.HTTPS:
            return 'https://' + href
        else:
            return 'http://' + href


class JobSerializer(serializers.ModelSerializer):

    job_id = serializers.UUIDField(source='id')
    owner_id = serializers.UUIDField(source='owner.username')
    quote = serializers.SerializerMethodField()
    destruction = serializers.DateTimeField(source='destruction_time')

    class Meta:
        model = Job
        fields = (
            'job_id',
            'owner_id',
            'phase',
            'quote',
            'start_time',
            'end_time',
            'execution_duration',
            'destruction'
        )

    def get_quote(self, obj):
        return None<commit_msg>streamlining<commit_after>from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse

from rest_framework import serializers

from .models import Job


class JobsSerializer(serializers.ModelSerializer):

    href = serializers.SerializerMethodField()

    class Meta:
        model = Job
        fields = ('id', 'phase', 'href')

    def get_href(self, obj):
        href = Site.objects.get_current().domain + reverse('uws:job-detail', args=[obj.id])

        if settings.HTTPS:
            return 'https://' + href
        else:
            return 'http://' + href


class JobSerializer(serializers.ModelSerializer):

    job_id = serializers.UUIDField(source='id')
    owner_id = serializers.UUIDField(source='owner.username')
    quote = serializers.SerializerMethodField()
    destruction = serializers.DateTimeField(source='destruction_time')

    class Meta:
        model = Job
        fields = (
            'job_id',
            'owner_id',
            'phase',
            'quote',
            'start_time',
            'end_time',
            'execution_duration',
            'destruction'
        )
{'fraction_non_alphanumeric': 0.10537105371053711, 'fraction_numerical': 0.0, 'mean_word_length': 2.4512022630834513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6316624', 'n_tokens_mistral': 676, 'n_tokens_neox': 658, 'n_words': 148}