<commit_before># vim:ts=4:sts=4:sw=4:expandtab

from django.db import models

from satori.core.dbev   import Events
from satori.core.models import Entity

#@ExportModel
class TestMapping(Entity):
    """Model. Intermediary for many-to-many relationship between TestSuites and
    Tests.
    """
    parent_entity = models.OneToOneField(Entity, parent_link=True, related_name='cast_testmapping')

    suite         = models.ForeignKey('TestSuite', related_name='test_mappings+')
    test          = models.ForeignKey('Test', related_name='test_mappings+')
    order         = models.IntegerField()

    params        = AttributeGroupField(PCArg('self', 'MANAGE'), PCDeny(), '')

    class Meta:                                                # pylint: disable-msg=C0111
        unique_together = (('suite', 'test'), ('suite', 'order'))
        ordering        = ('order',)

#    class ExportMeta(object):
#        fields = [('suite', 'VIEW'), ('test', 'VIEW'), ('order', 'VIEW')]

    def save(*args, **kwargs):
        self.fixup_params()
        super(TestMapping, self).save(*args, **kwargs)

class TestMappingEvents(Events):
    model = TestMapping
    on_insert = on_update = ['suite', 'test']
    on_delete = []<commit_msg>Added mising self in TestMapping.save().<commit_after># vim:ts=4:sts=4:sw=4:expandtab

from django.db import models

from satori.core.dbev   import Events
from satori.core.models import Entity

#@ExportModel
class TestMapping(Entity):
    """Model. Intermediary for many-to-many relationship between TestSuites and
    Tests.
    """
    parent_entity = models.OneToOneField(Entity, parent_link=True, related_name='cast_testmapping')

    suite         = models.ForeignKey('TestSuite', related_name='test_mappings+')
    test          = models.ForeignKey('Test', related_name='test_mappings+')
    order         = models.IntegerField()

    params        = AttributeGroupField(PCArg('self', 'MANAGE'), PCDeny(), '')

    class Meta:                                                # pylint: disable-msg=C0111
        unique_together = (('suite', 'test'), ('suite', 'order'))
        ordering        = ('order',)

#    class ExportMeta(object):
#        fields = [('suite', 'VIEW'), ('test', 'VIEW'), ('order', 'VIEW')]

    def save(self, *args, **kwargs):
        self.fixup_params()
        super(TestMapping, self).save(*args, **kwargs)

class TestMappingEvents(Events):
    model = TestMapping
    on_insert = on_update = ['suite', 'test']
    on_delete = []
{'fraction_non_alphanumeric': 0.14584170349537967, 'fraction_numerical': 0.00562474889513861, 'mean_word_length': 3.0686274509803924, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4619092', 'n_tokens_mistral': 745, 'n_tokens_neox': 736, 'n_words': 161}