<commit_before>from datetime import datetime

from dateutil import rrule
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
from django.db import models
from django.db.models import Q
from mezzanine.utils.sites import current_site_id
from mezzanine.core.models import Displayable, RichText, SiteRelated

__all__ = (
    'EventCategory',
    'Event',
    'Occurrence',
    'create_event'
)


@python_2_unicode_compatible
class EventCategory(SiteRelated):
    '''
    Simple ``Event`` classifcation.

    '''
    name = models.CharField(_('name'), max_length=50, unique=True)
    description = models.CharField(_('description'), blank=True, null=True,
                                   max_length=255)
    color = models.CharField(_('color'), max_length=10, blank=True, null=True)

    class Meta:
        verbose_name = _('event category')<commit_msg>Category name doesn't have to be unique anymore.<commit_after>from datetime import datetime

from dateutil import rrule
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
from django.db import models
from django.db.models import Q
from mezzanine.utils.sites import current_site_id
from mezzanine.core.models import Displayable, RichText, SiteRelated

__all__ = (
    'EventCategory',
    'Event',
    'Occurrence',
    'create_event'
)


@python_2_unicode_compatible
class EventCategory(SiteRelated):
    '''
    Simple ``Event`` classifcation.

    '''
    name = models.CharField(_('name'), max_length=50)
    description = models.CharField(_('description'), blank=True, null=True,
                                   max_length=255)
    color = models.CharField(_('color'), max_length=10, blank=True, null=True)

    class Meta:
        verbose_name = _('event category')
{'fraction_non_alphanumeric': 0.09553478712357218, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 4.044502617801047, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7211205', 'n_tokens_mistral': 578, 'n_tokens_neox': 542, 'n_words': 143}