<commit_before># This file is part of the FifoCI project.
# Copyright (c) 2014 <NAME> <<EMAIL>>
# Licensing information: see $REPO_ROOT/LICENSE

from django.db import models


class FifoTest(models.Model):
    file = models.FileField(upload_to="dff/", max_length=256)
    name = models.CharField(max_length=128)
    shortname = models.CharField(max_length=32, db_index=True)
    active = models.BooleanField(default=True, db_index=True)
    description = models.TextField(blank=True)

    @models.permalink
    def get_absolute_url(self):
        return ('dff-view', [self.shortname])

    def __str__(self):
        return self.shortname


class Version(models.Model):
    hash = models.CharField(max_length=40, db_index=True)
    name = models.CharField(max_length=64, db_index=True)
    parent = models.ForeignKey('self', null=True, blank=True, db_index=True)
    parent_hash = models.CharField(max_length=40)
    submitted = models.BooleanField(default=False, db_index=True)
    ts = models.DateTimeField(auto_now_add=True, blank=True, db_index=True)

    @models.permalink
    def get_absolute_url(self):
        return ('version-view', [self.hash])

    def __str__(self):
        return '%s (%s)' % (self.name, self.hash[:8])


class Type(models.Model):
    type = models.CharField(max_length=64, unique=True)

    def __str__(self):
        return self.type


class Result(models.Model):
    dff = models.ForeignKey(FifoTest)
    ver = models.ForeignKey(Version, related_name='results')
    type = models.ForeignKey(Type)
    has_change = models.BooleanField(default=False, db_index=True)
    first_result = models.BooleanField(default=False, db_index=True)

    # Format: "h1,h2,h3,...,hN"
    hashes = models.TextField()

    @models.permalink
    def get_absolute_url(self):
        return ('result-view', [self.id])

    @property
    def hashes_list(self):
        return self.hashes.split(',')

    def __str__(self):
        return '%s / %s / %s' % (self.dff, self.ver, self.type)<commit_msg>Drop unused indices.<commit_after># This file is part of the FifoCI project.
# Copyright (c) 2014 <NAME> <<EMAIL>>
# Licensing information: see $REPO_ROOT/LICENSE

from django.db import models


class FifoTest(models.Model):
    file = models.FileField(upload_to="dff/", max_length=256)
    name = models.CharField(max_length=128)
    shortname = models.CharField(max_length=32, db_index=True)
    active = models.BooleanField(default=True, db_index=True)
    description = models.TextField(blank=True)

    @models.permalink
    def get_absolute_url(self):
        return ('dff-view', [self.shortname])

    def __str__(self):
        return self.shortname


class Version(models.Model):
    hash = models.CharField(max_length=40, db_index=True)
    name = models.CharField(max_length=64, db_index=True)
    parent = models.ForeignKey('self', null=True, blank=True, db_index=True)
    parent_hash = models.CharField(max_length=40)
    submitted = models.BooleanField(default=False, db_index=True)
    ts = models.DateTimeField(auto_now_add=True, blank=True, db_index=True)

    @models.permalink
    def get_absolute_url(self):
        return ('version-view', [self.hash])

    def __str__(self):
        return '%s (%s)' % (self.name, self.hash[:8])


class Type(models.Model):
    type = models.CharField(max_length=64, unique=True)

    def __str__(self):
        return self.type


class Result(models.Model):
    dff = models.ForeignKey(FifoTest)
    ver = models.ForeignKey(Version, related_name='results')
    type = models.ForeignKey(Type)
    has_change = models.BooleanField(default=False)
    first_result = models.BooleanField(default=False)

    # Format: "h1,h2,h3,...,hN"
    hashes = models.TextField()

    @models.permalink
    def get_absolute_url(self):
        return ('result-view', [self.id])

    @property
    def hashes_list(self):
        return self.hashes.split(',')

    def __str__(self):
        return '%s / %s / %s' % (self.dff, self.ver, self.type)
{'fraction_non_alphanumeric': 0.13204710598847408, 'fraction_numerical': 0.01202706088699574, 'mean_word_length': 3.868292682926829, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6686341', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1313, 'n_words': 259}