<commit_before>from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _

from core.mixins import ModelDiffMixin, DisplayMixin

from constants import *
from utils import *

######## Data requests #################
class Ticket(models.Model, ModelDiffMixin, DisplayMixin):  # polymodel.PolyModel
    """
    Common fields for all ticket types

    Note: Implement volunteers as a separate list of fields from responders,
    so that permissions stay simple.
    """
    ticket_type = ""
    # Staff-facing fields
    requester = models.ForeignKey(User, related_name="ticket_requests")
    requester_type = models.CharField(max_length=70, choices=REQUESTER_TYPES,
                                    verbose_name=_('Requester Type'))
    responders = models.ManyToManyField(User, related_name="tickets_responded")

    volunteers = models.ManyToManyField(User, related_name="tickets_volunteered")

    created = models.DateTimeField(auto_now_add=True)
    status = models.CharField(max_length=70, choices=TICKET_STATUS, default='new')
    status_updated = models.DateTimeField(auto_now=True)
    findings_visible = models.BooleanField(default=False,
                                           verbose_name=_('Findings Public'))
    is_for_profit = models.BooleanField(default=False,
                                        verbose_name=_('For-Profit?'))
    is_public = models.BooleanField(default=False,
                                    verbose_name=_('Public?'))
    flagged = models.BooleanField(default=False)
    user_pays = models.BooleanField(default=True)
    deadline = models.DateField(null=False, blank=False, verbose_name=_('Deadline'))
    sensitive = models.BooleanField(default=False, verbose_name=_('Sensitive?'))

    tag_id = models.CharField(max_length=60, blank=True)    # Refers to this Ticket's Podaci tag.

    def most_fields(self):
        '''Return an iterator of tuples (verbose name, display value)
        for all fields which can be shown to everybody on the ticket'''
        output = [
            (_('Summary'), self.summary),
            (_('Requested by'), self.requester.get().display_name),<commit_msg>updated to ticket model to allow for a blank deadline<commit_after>from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _

from core.mixins import ModelDiffMixin, DisplayMixin

from constants import *
from utils import *

######## Data requests #################
class Ticket(models.Model, ModelDiffMixin, DisplayMixin):  # polymodel.PolyModel
    """
    Common fields for all ticket types

    Note: Implement volunteers as a separate list of fields from responders,
    so that permissions stay simple.
    """
    ticket_type = ""
    # Staff-facing fields
    requester = models.ForeignKey(User, related_name="ticket_requests")
    requester_type = models.CharField(max_length=70, choices=REQUESTER_TYPES,
                                    verbose_name=_('Requester Type'))
    responders = models.ManyToManyField(User, related_name="tickets_responded")

    volunteers = models.ManyToManyField(User, related_name="tickets_volunteered")

    created = models.DateTimeField(auto_now_add=True)
    status = models.CharField(max_length=70, choices=TICKET_STATUS, default='new')
    status_updated = models.DateTimeField(auto_now=True)
    findings_visible = models.BooleanField(default=False,
                                           verbose_name=_('Findings Public'))
    is_for_profit = models.BooleanField(default=False,
                                        verbose_name=_('For-Profit?'))
    is_public = models.BooleanField(default=False,
                                    verbose_name=_('Public?'))
    flagged = models.BooleanField(default=False)
    user_pays = models.BooleanField(default=True)
    deadline = models.DateField(null=True, blank=True, verbose_name=_('Deadline'))
    sensitive = models.BooleanField(default=False, verbose_name=_('Sensitive?'))

    tag_id = models.CharField(max_length=60, blank=True)    # Refers to this Ticket's Podaci tag.

    def most_fields(self):
        '''Return an iterator of tuples (verbose name, display value)
        for all fields which can be shown to everybody on the ticket'''
        output = [
            (_('Summary'), self.summary),
            (_('Requested by'), self.requester.get().display_name),
{'fraction_non_alphanumeric': 0.10538116591928251, 'fraction_numerical': 0.0026905829596412557, 'mean_word_length': 3.382121807465619, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1951846', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1205, 'n_words': 282}