<commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _
import reversion

from contacts.rules.organization import is_organization_member
from vertex import rules
from vertex.rules.predicates import has_django_permission, is_staff, is_superuser
from vertex.models import AbstractDatedModel

__author__ = '<NAME> <<EMAIL>>'


@reversion.register
class Organization(AbstractDatedModel):
    """Organization model."""
    parent = models.ForeignKey(
        'self',
        verbose_name=_("Parent"),
        blank=True,
        null=True,
        related_name='children'
    )

    name = models.CharField(
        _('Name'),
        max_length=200
    )

    people = models.ManyToManyField(
        "contacts.Person",
        related_name='organizations',

    )

    administrators = models.ManyToManyField(
        "contacts.Person",
        related_name='managed_organizations',
    )

    notes = models.TextField(
        blank=True,
        null=True
    )

    class Meta:
        ordering = ('name',)
        verbose_name = _('Organization')
        verbose_name_plural = _('Organizations')
        app_label = 'contacts'

    def __str__(self):
        return u"{name}".format(name=self.name)


class OrganizationAlias(AbstractDatedModel):
    name = models.CharField(max_length=200)
    organization = models.ForeignKey('contacts.Organization', related_name='aliases')<commit_msg>Proper model name representation in admin<commit_after>from django.db import models
from django.utils.translation import ugettext_lazy as _
import reversion

from contacts.rules.organization import is_organization_member
from vertex import rules
from vertex.rules.predicates import has_django_permission, is_staff, is_superuser
from vertex.models import AbstractDatedModel

__author__ = '<NAME> <<EMAIL>>'


@reversion.register
class Organization(AbstractDatedModel):
    """Organization model."""
    parent = models.ForeignKey(
        'self',
        verbose_name=_("Parent"),
        blank=True,
        null=True,
        related_name='children'
    )

    name = models.CharField(
        _('Name'),
        max_length=200
    )

    people = models.ManyToManyField(
        "contacts.Person",
        related_name='organizations',

    )

    administrators = models.ManyToManyField(
        "contacts.Person",
        related_name='managed_organizations',
    )

    notes = models.TextField(
        blank=True,
        null=True
    )

    class Meta:
        ordering = ('name',)
        verbose_name = _('organization')
        verbose_name_plural = _('organizations')
        app_label = 'contacts'

    def __str__(self):
        return u"{name}".format(name=self.name)


class OrganizationAlias(AbstractDatedModel):
    name = models.CharField(max_length=200)
    organization = models.ForeignKey('contacts.Organization', related_name='aliases')

    class Meta:
        ordering = ('name',)
        verbose_name = _('organization alias')
        verbose_name_plural = _('organization aliases')
        app_label = 'contacts'
{'fraction_non_alphanumeric': 0.1015625, 'fraction_numerical': 0.00390625, 'mean_word_length': 3.1923601637107777, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4128145', 'n_tokens_mistral': 901, 'n_tokens_neox': 860, 'n_words': 178}