<commit_before>from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from apps.project_sheet.models import I4pProjectTranslation
from askbot.models.question import Thread
from apps.tags.models import TaggedCategory

SUPPORT_TYPE_CHOICES = (
    ("CALL", _("call for help")),
    ("PROP", _("help proposal")),
)

class ProjectSupport(models.Model):
    project_translation = models.ForeignKey(I4pProjectTranslation)
    type = models.CharField(max_length=4, choices=SUPPORT_TYPE_CHOICES)
    category = models.ForeignKey(TaggedCategory)
    thread = models.ForeignKey(Thread)

    def get_absolute_url(self):
        return reverse("project_support_view", args=[self.project_translation.slug, self.thread.question.id])
    
    def save(self, force_insert=False, force_update=False, using=None):
        models.Model.save(self, force_insert=force_insert, force_update=force_update, using=using)
        if not self.thread.is_specific:
            self.thread.is_specific = True
            self.thread.save()<commit_msg>change labels<commit_after>from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from apps.project_sheet.models import I4pProjectTranslation
from askbot.models.question import Thread
from apps.tags.models import TaggedCategory

SUPPORT_TYPE_CHOICES = (
    ("CALL", _("project needs")),
    ("PROP", _("project offers")),
)

class ProjectSupport(models.Model):
    project_translation = models.ForeignKey(I4pProjectTranslation)
    type = models.CharField(max_length=4, choices=SUPPORT_TYPE_CHOICES)
    category = models.ForeignKey(TaggedCategory)
    thread = models.ForeignKey(Thread)

    def get_absolute_url(self):
        return reverse("project_support_view", args=[self.project_translation.slug, self.thread.question.id])
    
    def save(self, force_insert=False, force_update=False, using=None):
        models.Model.save(self, force_insert=force_insert, force_update=force_update, using=using)
        if not self.thread.is_specific:
            self.thread.is_specific = True
            self.thread.save()
{'fraction_non_alphanumeric': 0.09675947056138749, 'fraction_numerical': 0.0027384755819260614, 'mean_word_length': 4.753280839895013, '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': '5806289', 'n_tokens_mistral': 635, 'n_tokens_neox': 630, 'n_words': 129}