<commit_before>from django.db import models
from django.conf import settings

class Playbook(models.Model):
    name = models.CharField(max_length=200)
    inventory = models.CharField(max_length=200, default="hosts")
    user = models.CharField(max_length=200, default="ubuntu")
    directory = models.CharField(max_length=200, editable=False, default="dir")

    def __str__(self):
        return "%s" % self.name

    def format_directory(self):
        directory = self.name.lower()
        directory = directory.replace(" ","-")
        return directory

    def save(self, *args, **kwargs):
        self.directory = self.format_directory()
        super(Playbook, self).save(*args, **kwargs)

    class Meta:
        verbose_name_plural = "playbooks"


class Registry(models.Model):
    playbook = models.ForeignKey("Playbook", default=1, on_delete=models.CASCADE)
    name = models.CharField(max_length=200)
    item = models.FilePathField(path=settings.PLAYBOOK_DIR, recursive=True)

    def __str__(self):
        return "%s" % self.name

    class Meta:
        verbose_name_plural = "registries"<commit_msg>Rename Registry.item to Registry.file_path<commit_after>from django.db import models
from django.conf import settings

class Playbook(models.Model):
    name = models.CharField(max_length=200)
    inventory = models.CharField(max_length=200, default="hosts")
    user = models.CharField(max_length=200, default="ubuntu")
    directory = models.CharField(max_length=200, editable=False, default="dir")

    def __str__(self):
        return "%s" % self.name

    def format_directory(self):
        directory = self.name.lower()
        directory = directory.replace(" ","-")
        return directory

    def save(self, *args, **kwargs):
        self.directory = self.format_directory()
        super(Playbook, self).save(*args, **kwargs)

    class Meta:
        verbose_name_plural = "playbooks"


class Registry(models.Model):
    playbook = models.ForeignKey("Playbook", default=1, on_delete=models.CASCADE)
    name = models.CharField(max_length=200)
    file_path = models.FilePathField(path=settings.PLAYBOOK_DIR, recursive=True)

    def __str__(self):
        return "%s" % self.name

    def modify_item_file_path(self):
        return self.item

    def save(self, *args, **kwargs):
        self.item = self.modify_item_file_path()
        super(Registry, self).save(*args, **kwargs)

    class Meta:
        verbose_name_plural = "registries"
{'fraction_non_alphanumeric': 0.12176375404530744, 'fraction_numerical': 0.012944983818770227, 'mean_word_length': 3.648496240601504, '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': '1838273', 'n_tokens_mistral': 791, 'n_tokens_neox': 738, 'n_words': 151}