<commit_before>"""Models of Zinnia CMS Plugins"""
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible

from cms.models.pluginmodel import CMSPlugin

from cmsplugin_zinnia.settings import PLUGINS_TEMPLATES

TEMPLATES = [
    ('cmsplugin_zinnia/entry_list.html', _('Entry list (default)')),
    ('cmsplugin_zinnia/entry_detail.html', _('Entry detailed')),
    ('cmsplugin_zinnia/entry_slider.html', _('Entry slider'))] \
    + PLUGINS_TEMPLATES


@python_2_unicode_compatible
class LatestEntriesPlugin(CMSPlugin):
    """
    CMS Plugin for displaying latest entries
    """

    featured = models.NullBooleanField(
        _('featured'),
        blank=True, null=True,
        choices=((True, _('Show featured entries only')),
                 (False, _('Hide featured entries'))))
    categories = models.ManyToManyField(
        'zinnia.Category', verbose_name=_('categories'),
        blank=True, null=True)
    subcategories = models.BooleanField(
        _('include subcategories'), default=True,
        help_text=_('include the entries belonging the subcategories'))
    authors = models.ManyToManyField(
        'zinnia.Author', verbose_name=_('authors'),
        blank=True, null=True)
    tags = models.ManyToManyField(
        'tagging.Tag', verbose_name=_('tags'),
        blank=True, null=True)

    number_of_entries = models.PositiveIntegerField(
        _('number of entries'), default=5,
        help_text=_('0 means all the entries'))
    offset = models.PositiveIntegerField(
        _('offset'), default=0,
        help_text=_('number of entries to skip from top of list'))
    template_to_render = models.CharField(<commit_msg>Fix 3 warnings of `manage.py check`<commit_after>"""Models of Zinnia CMS Plugins"""
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible

from cms.models.pluginmodel import CMSPlugin

from cmsplugin_zinnia.settings import PLUGINS_TEMPLATES

TEMPLATES = [
    ('cmsplugin_zinnia/entry_list.html', _('Entry list (default)')),
    ('cmsplugin_zinnia/entry_detail.html', _('Entry detailed')),
    ('cmsplugin_zinnia/entry_slider.html', _('Entry slider'))] \
    + PLUGINS_TEMPLATES


@python_2_unicode_compatible
class LatestEntriesPlugin(CMSPlugin):
    """
    CMS Plugin for displaying latest entries
    """

    featured = models.NullBooleanField(
        _('featured'),
        blank=True, null=True,
        choices=((True, _('Show featured entries only')),
                 (False, _('Hide featured entries'))))
    categories = models.ManyToManyField(
        'zinnia.Category', verbose_name=_('categories'),
        blank=True)
    subcategories = models.BooleanField(
        _('include subcategories'), default=True,
        help_text=_('include the entries belonging the subcategories'))
    authors = models.ManyToManyField(
        'zinnia.Author', verbose_name=_('authors'),
        blank=True)
    tags = models.ManyToManyField(
        'tagging.Tag', verbose_name=_('tags'),
        blank=True)

    number_of_entries = models.PositiveIntegerField(
        _('number of entries'), default=5,
        help_text=_('0 means all the entries'))
    offset = models.PositiveIntegerField(
        _('offset'), default=0,
        help_text=_('number of entries to skip from top of list'))
    template_to_render = models.CharField(
{'fraction_non_alphanumeric': 0.11413197394505806, 'fraction_numerical': 0.003115264797507788, 'mean_word_length': 3.811989100817439, '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': '2980921', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1024, 'n_words': 241}