<commit_before>import datetime

from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slugify
from django.utils import timezone
from markupfield.fields import MarkupField

from .managers import JobManager
from cms.models import ContentManageable, NameSlugModel


DEFAULT_MARKUP_TYPE = getattr(settings, 'DEFAULT_MARKUP_TYPE', 'restructuredtext')


class JobType(NameSlugModel):

    class Meta(object):
        verbose_name = 'job type'
        verbose_name_plural = 'job types'


class JobCategory(NameSlugModel):

    class Meta(object):
        verbose_name = 'job category'
        verbose_name_plural = 'job categories'


class Job(ContentManageable):
    NEW_THRESHOLD = datetime.timedelta(days=30)

    category = models.ForeignKey(JobCategory, related_name='jobs')
    job_types = models.ManyToManyField(JobType, related_name='jobs', blank=True)
    company = models.ForeignKey('companies.Company', related_name='jobs')

    city = models.CharField(max_length=100)
    region = models.CharField(max_length=100)
    country = models.CharField(max_length=100, db_index=True)
    location_slug = models.SlugField(max_length=350, editable=False)

    description = MarkupField(blank=True, default_markup_type=DEFAULT_MARKUP_TYPE)
    requirements = MarkupField(blank=True, default_markup_type=DEFAULT_MARKUP_TYPE)

    contact = models.CharField(null=True, blank=True, max_length=100)
    email = models.EmailField()
    url = models.URLField('URL', null=True, blank=True)

    STATUS_DRAFT = 'draft'
    STATUS_REVIEW = 'review'
    STATUS_APPROVED = 'approved'
    STATUS_REJECTED = 'rejected'
    STATUS_ARCHIVED = 'archived'
    STATUS_REMOVED = 'removed'
    STATUS_EXPIRED = 'expired'

    STATUS_CHOICES = (
        (STATUS_DRAFT, 'draft'),<commit_msg>Sort JobCategory and JobType by name<commit_after>import datetime

from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slugify
from django.utils import timezone
from markupfield.fields import MarkupField

from .managers import JobManager
from cms.models import ContentManageable, NameSlugModel


DEFAULT_MARKUP_TYPE = getattr(settings, 'DEFAULT_MARKUP_TYPE', 'restructuredtext')


class JobType(NameSlugModel):

    class Meta(object):
        verbose_name = 'job type'
        verbose_name_plural = 'job types'
        ordering = ('name', )


class JobCategory(NameSlugModel):

    class Meta(object):
        verbose_name = 'job category'
        verbose_name_plural = 'job categories'
        ordering = ('name', )


class Job(ContentManageable):
    NEW_THRESHOLD = datetime.timedelta(days=30)

    category = models.ForeignKey(JobCategory, related_name='jobs')
    job_types = models.ManyToManyField(JobType, related_name='jobs', blank=True)
    company = models.ForeignKey('companies.Company', related_name='jobs')

    city = models.CharField(max_length=100)
    region = models.CharField(max_length=100)
    country = models.CharField(max_length=100, db_index=True)
    location_slug = models.SlugField(max_length=350, editable=False)

    description = MarkupField(blank=True, default_markup_type=DEFAULT_MARKUP_TYPE)
    requirements = MarkupField(blank=True, default_markup_type=DEFAULT_MARKUP_TYPE)

    contact = models.CharField(null=True, blank=True, max_length=100)
    email = models.EmailField()
    url = models.URLField('URL', null=True, blank=True)

    STATUS_DRAFT = 'draft'
    STATUS_REVIEW = 'review'
    STATUS_APPROVED = 'approved'
    STATUS_REJECTED = 'rejected'
    STATUS_ARCHIVED = 'archived'
    STATUS_REMOVED = 'removed'
    STATUS_EXPIRED = 'expired'

    STATUS_CHOICES = (
        (STATUS_DRAFT, 'draft'),
{'fraction_non_alphanumeric': 0.09365956327282295, 'fraction_numerical': 0.008945014469876349, 'mean_word_length': 4.778115501519757, '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': '1146895', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1169, 'n_words': 240}