<commit_before>from django.db import models
from django.contrib.auth.models import User

DEBUG = 1
INFO = 2
SUCCESS = 3
WARNING = 4
ERROR = 5
CRITICAL = 6

LEVEL_CHOICES = (
        (DEBUG, 'DEBUG'),
        (INFO, 'INFO'),
        (SUCCESS, 'SUCCESS'),
        (WARNING, 'WARNING'),
        (ERROR, 'ERROR'),
        (CRITICAL, 'CRITICAL'),
)


class Subscription(models.Model):

    user = models.ForeignKey(User)
#TODO: Change message_channel to channel
    message_channel = models.ForeignKey('Channel')
    level = models.IntegerField(default=INFO,
            choices=LEVEL_CHOICES)
    platforms = models.ManyToManyField('Platform',
            through='SubscriptionPlatform')
    disabled = models.BooleanField(default=False)

    def __unicode__(self):
        return '%s subscribed to: %s' % (self.user.username,
                self.message_channel.name)


class SubscriptionMeta(models.Model):

    value = models.TextField()
    subscription = models.ForeignKey('Subscription')

    def __unicode__(self):
        return self.value


class Channel(models.Model):

    name = models.CharField(max_length=255)

    def __unicode__(self):
        return self.name


class Platform(models.Model):

    name = models.CharField(max_length=255)
    handler = models.CharField(max_length=255)

    def __unicode__(self):
        return self.name


class SubscriptionPlatform(models.Model):

    subscription = models.ForeignKey('Subscription')
    platform = models.ForeignKey('Platform')


class Telegram(models.Model):

    channel = models.ForeignKey('Channel')
    subject = models.CharField(max_length=255)<commit_msg>Added description to channel model<commit_after>from django.db import models
from django.contrib.auth.models import User

DEBUG = 1
INFO = 2
SUCCESS = 3
WARNING = 4
ERROR = 5
CRITICAL = 6

LEVEL_CHOICES = (
        (DEBUG, 'DEBUG'),
        (INFO, 'INFO'),
        (SUCCESS, 'SUCCESS'),
        (WARNING, 'WARNING'),
        (ERROR, 'ERROR'),
        (CRITICAL, 'CRITICAL'),
)


class Subscription(models.Model):

    user = models.ForeignKey(User)
#TODO: Change message_channel to channel
    message_channel = models.ForeignKey('Channel')
    level = models.IntegerField(default=INFO,
            choices=LEVEL_CHOICES)
    platforms = models.ManyToManyField('Platform',
            through='SubscriptionPlatform')
    disabled = models.BooleanField(default=False)

    def __unicode__(self):
        return '%s subscribed to: %s' % (self.user.username,
                self.message_channel.name)


class SubscriptionMeta(models.Model):

    value = models.TextField()
    subscription = models.ForeignKey('Subscription')

    def __unicode__(self):
        return self.value


class Channel(models.Model):

    name = models.CharField(max_length=255)
    description = models.TextField(null=True, blank=True)

    def __unicode__(self):
        return self.name


class Platform(models.Model):

    name = models.CharField(max_length=255)
    handler = models.CharField(max_length=255)

    def __unicode__(self):
        return self.name


class SubscriptionPlatform(models.Model):

    subscription = models.ForeignKey('Subscription')
    platform = models.ForeignKey('Platform')


class Telegram(models.Model):

    channel = models.ForeignKey('Channel')
    subject = models.CharField(max_length=255)
{'fraction_non_alphanumeric': 0.1136431784107946, 'fraction_numerical': 0.010794602698650674, 'mean_word_length': 3.4126984126984126, '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': '1412950', 'n_tokens_mistral': 1007, 'n_tokens_neox': 945, 'n_words': 208}