<commit_before># -*- coding: utf-8 -*-s
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.sites.models import Site
from picklefield import PickledObjectField
from .managers import OptionManager


class Option(models.Model):

    site = models.ForeignKey(Site, related_name='options')

    key = models.CharField(max_length=255,
                           verbose_name=_('Key'))
    value = PickledObjectField(null=True, default=True,
                               verbose_name=_('Value'))
    autoload = models.BooleanField(default=False,
                                   verbose_name=_('Autoload'))

    updated_at = models.DateTimeField(auto_now=True,
                                      verbose_name=_('Update at'))
    created_at = models.DateTimeField(auto_now_add=True,
                                      verbose_name=_('Create at'))
    expires_at = models.DateTimeField(blank=True, null=True,
                                      verbose_name=_('Expires at'))

    # override default manager
    objects = OptionManager()
    all = models.Manager()
    on_site = objects

    class Meta:
        unique_together = ('site', 'key',)
        verbose_name = _('Option')
        verbose_name_plur = _('Options')<commit_msg>fix models pulr<commit_after># -*- coding: utf-8 -*-s
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.sites.models import Site
from picklefield import PickledObjectField
from .managers import OptionManager


class Option(models.Model):

    site = models.ForeignKey(Site, related_name='options',
                             verbose_name=_('Site'))

    key = models.CharField(max_length=255,
                           verbose_name=_('Key'))
    value = PickledObjectField(null=True, default=True,
                               verbose_name=_('Value'))
    autoload = models.BooleanField(default=False,
                                   verbose_name=_('Autoload'))

    updated_at = models.DateTimeField(auto_now=True,
                                      verbose_name=_('Update at'))
    created_at = models.DateTimeField(auto_now_add=True,
                                      verbose_name=_('Create at'))
    expires_at = models.DateTimeField(blank=True, null=True,
                                      verbose_name=_('Expires at'))

    # override default manager
    objects = OptionManager()
    all = models.Manager()
    on_site = objects

    class Meta:
        unique_together = ('site', 'key',)
        verbose_name = _('Option')
        verbose_name_plural = _('Options')
{'fraction_non_alphanumeric': 0.10049486105824133, 'fraction_numerical': 0.0030452988199467074, 'mean_word_length': 2.216646266829865, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2231690', 'n_tokens_mistral': 719, 'n_tokens_neox': 686, 'n_words': 144}